"use strict";

var e, t, n, o, i, a, r, s, c, l, d, u, p, h, f, g, m;
var Adv_skd=require("./Adv_skd");
function y(t, e) {
    const o = v();
    return (y = function(t) {
        return o[t -= 193];
    })(t, e);
}

function v() {
    const t = ["2431072dOcDXC", "262966NaRQIY", "2628544czmZrN", "275vbsqSV", "21TTDPwZ", "6553053oztXYa", "951450DsEMwA", "364njiYog", "6668BdZtRk"];
    return (v = function() {
        return t;
    })();
}

(function() {
    const t = y,
        e = v();
    for (;;) try {
        if (174977 == +parseInt(t(194)) + -parseInt(t(201)) / 2 * (-parseInt(t(197)) / 3) + parseInt(t(200)) / 4 * (-parseInt(t(196)) / 5) + -parseInt(t(199)) / 6 + -parseInt(t(193)) / 7 + -parseInt(t(195)) / 8 + parseInt(t(198)) / 9) break;
        e.push(e.shift());
    } catch (t) {
        e.push(e.shift());
    }
})(), (h = h || {}).BaseAppProxy = class {
        signInGoogle() {
            console.log("BaseAppProxy signInGoogle");
        }
        signInGoogleSilently() {
            console.log("BaseAppProxy signInGoogleSilently");
        }
        signOutGoogle() {
            console.log("BaseAppProxy signOutGoogle");
        }
        saveFile(t) {}
        loadSavefile() {}
        setNonConsumableProduct(t) {}
        getProductDetail(t) {}
        requestPayment(t) {}
        checkPurchase() {}
        fetchRemoteConfig() {}
        confirmPurchase(t) {}
        getRemoteConfig() {
            return new Map();
        }
        getOrderInfo(t) {
            return "";
        }
        restoreNonConsumablePurchase() {}
        onOfferwallAdCredited(t, e) {}
        onOfferwallAdClosed() {}
    },
    function(t) {
        var e;
        (e = t.Urls || (t.Urls = {})).SaveLog = "https://log.17tcw.com/collect/pushEvents",
            e.SaveRedirect = "https://game.17tcw.com/xyx/statis/reqSaveRedirect", e.GetNativationConfig = "https://game.17tcw.com/default/redirect/list",
            e.GameConfig = "https://game.17tcw.com/default/extra/getNewConfigs", e.SaveShare = "https://game.17tcw.com/xyx/statis/reqBeginShare",
            e.GetShareConfig = "https://game.17tcw.com/xyx/basic/reqFenxiang", e.GetUUID = "https://game.17tcw.com/game/wechat",
            e.GetRewardConfig = "https://game.17tcw.com/default/game/getShareStrategy", e.GameUrl = "https://game.17tcw.com",
            e.GetOpenId = "https://game.17tcw.com/default/login/authorize", e.UploadClickShare = "https://game.17tcw.com/default/game/clickShare",
            (e = t.EngineType || (t.EngineType = {})).Default = "Default", e.CocosCreator = "CocosCreator",
            e.LayaAir = "LayaAir", (e = t.Platform || (t.Platform = {})).Default = "Default",
            e.Kuaidianwan = "Kuaidianwan", e.WeChat = "WeChat", e.QQ = "QQ", e.OPPO = "OPPO",
            e.Vivo = "Vivo", e.BaiDu = "BaiDu", e.XiaoDu = "XiaoDu", e.QuTouTiao = "QuTouTiao",
            e.QuTouTiaoAndroid = "QuTouTiaoAndroid", e.ByteDance = "ByteDance", e.YueYou = "YueYou",
            e.KuaiKan = "KuaiKan", e.BaoQu = "BaoQu", e.Android = "Android", e.iOS = "iOS",
            e.UCMiniGame = "UCMiniGame", e.LianShangMiniGame = "LianShangMiniGame", e.Kwaigame = "Kwaigame",
            e.M4399MiniGame = "M4399MiniGame", e.Hago = "Hago", e.HuaWeiQuickGame = "HuaWeiQuickGame",
            (t = t.DistributionChannel || (t.DistributionChannel = {})).None = "", t.AppStore = "AppStore",
            t.AndroidOfficial = "AndroidOfficial", t.OPPO = "OPPO", t.M4399 = "M4399", t.M233 = "M233",
            t.HaoYouKuaiBao = "HaoYouKuaiBao", t.BaMenShenQi = "BaMenShenQi", t.YingYongBao = "YingYongBao",
            t.XiaoMi = "XiaoMi", t.GooglePlay = "GooglePlay", t.HuaweiGlobal = "HuaweiGlobal",
            t.MomoyuAndroid = "MomoyuAndroid";
    }(g = g || {}), (e = g = g || {}).Info = new class {
        constructor() {
            this.debugLog = !1, this.isPreview = !1, this.appId = "", this.platform = e.Platform.Default,
                this.engine = e.EngineType.Default, this.distributionChannel = e.DistributionChannel.None,
                this.channelId = "", this.channelKey = "", this.UUID = "", this.underCheck = !1,
                this.resolution = {
                    width: 0,
                    height: 0
                }, this.sharePath = "", this.nickname = "", this.avatar = "", this.scene = "", this.sceneWithSourceAppId = "",
                this.gameInBackground = !1, this.pageList = [], this.shareOption = null, this.shareTimes = 0,
                this.shareTime = 0, this.withoutRewardVideoAd = !1, this.version = "1.0.0", this.videoTopics = [],
                this.rewardConfigOriginData = new Map(), this.rewardUserData = {
                    time: 0,
                    data: new Map()
                }, this.shareData = [{
                    id: "",
                    templateId: "",
                    title: "",
                    url: ""
                }], this.shareFailTips = ["分享失败，请分享到群"];
        }
    }(),
    function(f) {
        function n(t) {
            var o, n, a, i, s, r, l, d;
            if (f.log("init evn", t), f.Info.debugLog = null !== (o = t.debugLog) && void 0 !== o && o,
                f.Info.isPreview = t.isPreview, f.Info.appId = t.appId, f.Info.platform = t.platform,
                f.Info.engine = t.engine, f.Info.channelKey = t.channelKey, f.Info.UUID = t.uuid,
                f.Info.resolution.width = t.resolution.width || 0, f.Info.resolution.height = t.resolution.height || 0,
                f.Info.sharePath = t.sharePath, f.Info.withoutRewardVideoAd = !!t.withoutRewardVideoAd,
                f.Info.version = t.version || "1.0.0", !f.isPlatform(f.Platform.M4399MiniGame)) {
                try {
                    var e = null === (n = f.PA.getSystemInfoSync) || void 0 === n ? void 0 : n.call(f.PA);
                    e.windowWidth / e.windowHeight > f.Info.resolution.width / f.Info.resolution.height ? f.Info.resolution.width = Math.round(e.windowWidth * f.Info.resolution.height / e.windowHeight) : f.Info.resolution.height = Math.round(e.windowHeight * f.Info.resolution.width / e.windowWidth);
                } catch (t) {
                    console.error(t);
                }! function() {
                    var t;
                    try {
                        var e = f.PA.getLaunchOptionsSync();
                        e.scene ? (f.Info.scene = e.scene + "", f.Info.sceneWithSourceAppId = e.scene + "") : e.from && f.isPlatform([f.Platform.Kwaigame]) && (f.Info.scene = e.from + "",
                                f.Info.sceneWithSourceAppId = e.from + ""), null != e && e.query && e.query[f.Info.channelKey] && (f.Info.channelId = f.Info.channelKey + "=" + e.query[f.Info.channelKey]),
                            null != e && e.referrerInfo && (f.Info.sourceAppid = null !== (t = e.referrerInfo.appId) && void 0 !== t ? t : "",
                                0 < f.Info.sourceAppid.length && (f.Info.sceneWithSourceAppId = f.Info.scene + "_" + f.Info.sourceAppid));
                    } catch (t) {
                        console.error(t);
                    }
                }();
                try {
                    const o = {
                        keepScreenOn: !0
                    };
                    null === (a = f.PA.setKeepScreenOn) || void 0 === a || a.call(f.PA, o), f.PA.onShow(() => {
                            var t, e, o, n, a, i, s, r;
                            if (f.Info.gameInBackground = !1, f.Info.lastGameTimeUploadTimestamp = Date.now(),
                                null === (t = f.PA.setKeepScreenOn) || void 0 === t || t.call(f.PA, {
                                    keepScreenOn: !0
                                }), null !== (t = f.Info.shareOption) && void 0 !== t && t.result) {
                                f.Info.shareTimes++;
                                var l, d = null !== (e = null === (t = f.Info.rewardConfigOriginData) || void 0 === t ? void 0 : t.get(null === (e = f.Info.shareOption) || void 0 === e ? void 0 : e.tag)) && void 0 !== e ? e : null === (d = f.Info.rewardConfigOriginData) || void 0 === d ? void 0 : d.get("SCORE_STRATEGY");
                                try {
                                    let t = null !== (n = null == d ? void 0 : d.shareSuccessRate[Math.min(f.Info.shareTimes - 1, (null === (o = null == d ? void 0 : d.shareSuccessRate) || void 0 === o ? void 0 : o.length) - 1)]) && void 0 !== n ? n : 0,
                                        e = Math.random() < t / 100;
                                    e || (l = null !== (i = 1e3 * (null == d ? void 0 : d.shareSuccessTime[Math.min(f.Info.shareTimes - 1, (null === (a = null == d ? void 0 : d.shareSuccessTime) || void 0 === a ? void 0 : a.length) - 1)])) ? i : 5e3,
                                        Date.now() - f.Info.shareTime >= l && 0 <= l && (e = !0));
                                    try {
                                        const c = {};
                                        c.reward = e, f.Info.shareOption.result(c);
                                    } catch (t) {}
                                    e ? (f.Info.shareTimes = 0, f.Info.shareOption = null) : null !== (r = null === (s = f.Info.shareOption) || void 0 === s ? void 0 : s.showFailTip) && void 0 !== r && !r || f.PA.showModal({
                                        title: "提示",
                                        content: function() {
                                            var t;
                                            let e = "";
                                            return 0 < (null === (t = null === f.Info || void 0 === f.Info ? void 0 : f.Info.shareFailTips) || void 0 === t ? void 0 : t.length) ? (e = f.Info.shareFailTips.shift(),
                                                f.Info.shareFailTips.push(e)) : e = "分享失败，请分享到新的群", e;
                                        }(),
                                        showCancel: !0,
                                        cancelText: "返回游戏",
                                        confirmText: "去分享",
                                        success: t => {
                                            t.cancel ? f.Info.shareOption = null : u(f.Info.shareOption);
                                        }
                                    });
                                } catch (t) {}
                            }
                        }), f.PA.onHide(() => {
                            f.Info.gameInBackground = !0, f.Info.openId && g(),
                                function() {
                                    try {
                                        f.Info.rewardUserData.time = Date.now();
                                        let n = {
                                            time: 0,
                                            data: []
                                        };
                                        n.time = f.Info.rewardUserData.time, f.Info.rewardUserData.data.forEach((t, e) => {
                                            const o = {};
                                            o.tag = e, o.currIndex = t.currIndex, o.currCount = t.currCount, n.data.push(o);
                                        }), f.PA.setStorageSync("RewardUserData", JSON.stringify(n));
                                    } catch (t) {
                                        console.error(t);
                                    }
                                }();
                        }), setInterval(() => {
                            f.Info.gameInBackground || g();
                        }, 1e3 * Math.max(null !== (i = t.uploadGameTimeIntervals) && void 0 !== i ? i : 10, 10)),
                        setInterval(() => {
                            0 < f.Info.pageList.length && (f.Info.pageList[f.Info.pageList.length - 1].time += 1);
                        }, 1e3);
                    const n = {
                        menus: ["shareAppMessage", "shareTimeline"]
                    };
                    null === (s = f.PA.showShareMenu) || void 0 === s || s.call(f.PA, n), null === (r = f.PA.onShareMessageToFriend) || void 0 === r || r.call(f.PA, t => {
                        console.log("onShareMessageToFriend:", t.success, t.errMsg);
                    });
                    let e = (n, a) => {
                        try {
                            let t = "",
                                e = {
                                    id: "",
                                    title: "",
                                    url: ""
                                },
                                o = {};
                            if ("video" == (n = null != n ? n : {
                                    channel: ""
                                }).channel) {
                                t = "openid=" + f.Info.openId + "&tm=" + Date.now().toFixed() + "&" + f.Info.channelKey + "=10001";
                                const n = {};
                                n.videoTopics = f.Info.videoTopics, o = n;
                                const s = {};
                                s["触发点"] = a, f.sentLog("拍抖音", null, s);
                            } else {
                                e = f.Info.shareData[f.rand(0, f.Info.shareData.length - 1)], f.request({
                                    url: f.Urls.SaveShare,
                                    method: "POST",
                                    data: {
                                        Openid: f.Info.openId,
                                        ShareId: e.id,
                                        ShareTm: Date.now().toFixed()
                                    }
                                }), t = "shareid=" + e.id + "&openid=" + f.Info.openId + "&tm=" + Date.now().toFixed() + "&" + f.Info.sharePath;
                                const n = {};
                                n["触发点"] = a, f.sentLog("分享", null, n);
                            }
                            const i = {};
                            return i.title = e.title, i.imageUrl = e.url, i.query = t, i.extra = o, i;
                        } catch (t) {
                            console.error(t);
                            const e = {};
                            return e["触发点"] = a, f.sentLog("分享", null, e), {
                                title: "",
                                imageUrl: "",
                                query: "openid=" + f.Info.openId + "&tm=" + Date.now().toFixed() + "&" + ("video" == (null == n ? void 0 : n.channel) ? f.Info.channelKey + "=10001" : f.Info.sharePath)
                            };
                        }
                    };
                    null === (l = f.PA.onShareAppMessage) || void 0 === l || l.call(f.PA, t => e(t, "顶部分享")),
                        null === (d = f.PA.onShareTimeline) || void 0 === d || d.call(f.PA, () => e(null, "分享朋友圈"));
                } catch (t) {
                    console.error(t);
                }
                (function() {
                    console.log("--------------* GA 基础配置和信息 *--------------"), console.log('Appid is "' + f.Info.appId + '"'),
                        console.log('Platform is "' + f.Info.platform + '"'), console.log('ChannelKey is "' + f.Info.channelKey + '"'),
                        console.log('ChannelID is "' + f.Info.channelId + '"'), console.log("SharePath is " + f.Info.sharePath),
                        console.log('UUID is "' + f.Info.UUID + '"'), console.log("GameEngine is " + f.Info.engine),
                        console.log("Design resolution is " + JSON.stringify(f.Info.resolution)), console.log("--------------* GA 使用域名清单 *---------------");
                    let t = new Set();
                    for (var e in f.Urls) {
                        e = f.Urls[e].split("/"), e = e[0] + "//" + e[2];
                        t.has(e) || (t.add(e), console.log(e));
                    }
                    console.log("----------------------------------------------");
                })();
            }
        }

        function c(t) {
            f.Info.openId = t, f.PA.setStorageSync("LocalOpenId", f.Info.openId);
        }

        function u(t) {
            var e;
            f.Info.shareOption = t, f.Info.shareTime = Date.now();
            let o = null;
            if (0 < f.Info.shareData.length && (o = f.Info.shareData[f.rand(0, f.Info.shareData.length - 1)]),
                f.Info.isPreview) {
                const n = {
                    reward: !0
                };
                null === (e = f.Info.shareOption) || void 0 === e || e.result(n), f.Info.shareOption = null;
            } else {
                f.PA.shareAppMessage({
                    templateId: null !== (e = o.templateId) && void 0 !== e ? e : "",
                    title: null !== (e = o.title) && void 0 !== e ? e : "",
                    imageUrl: null !== (e = o.url) && void 0 !== e ? e : "",
                    query: "shareid=" + (null !== (e = o.id) && void 0 !== e ? e : 0) + "&openid=" + f.Info.openId + "&tm=" + Date.now().toFixed() + "&" + f.Info.sharePath + (t.query ? "&" : "") + (null !== (e = t.query) && void 0 !== e ? e : ""),
                    success: () => {
                        console.log("分享接口成功回调，暂不开放");
                    },
                    fail: () => {
                        var t;
                        null === (t = f.Info.shareOption) || void 0 === t || t.result({
                            reward: !1
                        });
                    }
                }), f.request({
                    url: f.Urls.SaveShare,
                    method: "POST",
                    data: {
                        Openid: f.Info.openId,
                        ShareId: o.id,
                        ShareTm: Date.now().toFixed()
                    }
                });
                const a = {};
                a["触发点"] = null !== (t = t.tag) && void 0 !== t ? t : "未知", f.sentLog("分享", null, a);
            }
        }

        function g() {
            var t;
            f.isPlatform(f.Platform.Android) && f.Info.distributionChannel == f.DistributionChannel.GooglePlay || (t = Math.round((Date.now() - f.Info.lastGameTimeUploadTimestamp) / 1e3),
                f.sentLog("onlinetime", t, {
                    scene: f.Info.sceneWithSourceAppId
                }), f.Info.lastGameTimeUploadTimestamp = Date.now());
        }

        function o() {
            try {
                var e = f.PA.getStorageSync("RewardUserData");
                if (!e || "" == e) throw "loadRewardUserData:本地RewardUserData不存在";
                try {
                    let t = JSON.parse(e);
                    if (!(t.time > f.Info.rewardUserData.time && f.isToday(t.time))) throw "数据已过期";
                    if (f.Info.rewardUserData.time = t.time, f.Info.rewardUserData.data.clear(), t.data.length <= 0) throw "数据为空";
                    t.data.forEach(t => {
                        f.Info.rewardUserData.data.set(t.tag, {
                            currIndex: t.currIndex,
                            currCount: t.currCount
                        });
                    }), f.Info.rewardConfigOriginData.forEach((t, e) => {
                        if (!f.Info.rewardUserData.data.has(e)) {
                            const t = {
                                currIndex: 0,
                                currCount: 0
                            };
                            f.Info.rewardUserData.data.set(e, t);
                        }
                    });
                } catch (t) {
                    throw "loadRewardUserData:本地RewardUserData数据解析失败";
                }
            } catch (t) {
                f.log(t), f.Info.rewardUserData.time = Date.now(), f.Info.rewardUserData.data.clear(),
                    f.Info.rewardConfigOriginData.forEach((t, e) => {
                        if (0 < t.rule.length) {
                            const t = {
                                currIndex: 0,
                                currCount: 0
                            };
                            f.Info.rewardUserData.data.set(e, t);
                        }
                    });
            }
            f.log("RewardUserData", f.Info.rewardUserData);
        }
        (window.GA = f).PA = null, f.init = function(t) {
            var e, o;
            return console.log("GA3 Version:" + f.version + " buildTime:" + f.buildTime), "" == f.Info.appId ? (f.Info.debugLog = null !== (e = t.debugLog) && void 0 !== e && e,
                f.Info.isPreview = t.isPreview, f.Info.engine = t.engine, h.isAPP(t.platform) && (t.platform = h.getPlatform()),
                f.Info.platform = t.platform,
                function(t) {
                    var e, o, n;
                    let a = null;
                    switch (t) {
                        case f.Platform.Android:
                            a = h.PROXY;
                            break;

                        case f.Platform.WeChat:
                            a = null !== (e = window.wx) && void 0 !== e ? e : {};
                            break;

                        case f.Platform.QQ:
                            a = null !== (e = window.qq) && void 0 !== e ? e : {};
                            break;

                        case f.Platform.iOS:
                            a = h.PROXY;
                            break;

                        case f.Platform.OPPO:
                        case f.Platform.Vivo:
                            a = null !== (o = window.qg) && void 0 !== o ? o : {};
                            break;

                        case f.Platform.ByteDance:
                            a = null !== (o = window.tt) && void 0 !== o ? o : {};
                            break;

                        case f.Platform.Kwaigame:
                            a = null !== (n = window.ks) && void 0 !== n ? n : {};
                            break;

                        case f.Platform.Kuaidianwan:
                            a = {}, window.GameAssistantWeb ? (console.log("GameAssistantWeb is ok."), GameAssistantWeb.onGameLoaded()) : console.log("GameAssistantWeb is not ok.");
                            break;

                        case f.Platform.Hago:
                            a = null !== (n = window.hg) && void 0 !== n ? n : {};
                    }
                    f.PA = new f.PAClass(), f.PA.init(a);
                }(t.platform), h.isAPP() && (t.isPreview || (t.appId = null !== (o = null === (o = null === (o = f.PA.getLaunchOptionsSync()) || void 0 === o ? void 0 : o.query) || void 0 === o ? void 0 : o.appId) && void 0 !== o ? o : f.Info.appId),
                    f.Info.distributionChannel = null !== (o = null === (o = null === (o = f.PA.getLaunchOptionsSync()) || void 0 === o ? void 0 : o.query) || void 0 === o ? void 0 : o.distributionChannel) && void 0 !== o ? o : f.Info.distributionChannel),
                new Promise(e => {
                    h.setSplashAdEndListener(() => {
                        n(t), h.isAPP() ? e(null) : (f.isPlatform([f.Platform.WeChat]) && f.AdTracking.init(),
                            function t(e) {
                                e("")
                                    // f.isPlatform([f.Platform.M4399MiniGame, f.Platform.Android, f.Platform.iOS]) ? e("") : f.request({
                                    //     url: f.Urls.GetUUID,
                                    //     method: "POST",
                                    //     dataType: "其他",
                                    //     data: {
                                    //         appid: f.Info.appId
                                    //     },
                                    //     success: t => {
                                    //         try {
                                    //             e(t.data);
                                    //         } catch (t) {}
                                    //     },
                                    //     fail: () => {
                                    //         f.PA.showModal({
                                    //             title: "提示",
                                    //             content: "网络不稳定，连接服务器失败，请重试",
                                    //             showCancel: !1,
                                    //             confirmText: "重试",
                                    //             success: () => {
                                    //                 t(e);
                                    //             }
                                    //         });
                                    //     }
                                    // });
                            }(t => {
                                f.Info.underCheck = t == f.Info.UUID, f.log("Server UUID : ", t, " UnderCheck:", f.Info.underCheck),
                                    e(null);
                            }));
                    });
                })) : new Promise((t, e) => {
                e("GA has been initialization already.");
            });
        }, f.ENABLE_NEXT_VERSION = !1, f.setUserId = function(t) {
            f.Info.uid = t, null === (t = null === f.PA || void 0 === f.PA ? void 0 : f.PA.setUserId) || void 0 === t || t.call(f.PA, f.Info.uid.toFixed()),
                f.request({
                    url: f.Urls.GetRewardConfig,
                    data: {
                        appid: f.Info.appId,
                        userId: f.Info.uid
                    },
                    method: "POST",
                    success: t => {
                        var e;
                        0 == (null === (e = null == t ? void 0 : t.data) || void 0 === e ? void 0 : e.code) ? (t.data.data.forEach(t => {
                            f.Info.rewardConfigOriginData.set(t.tag, {
                                rule: t.rule,
                                shareSuccessRate: t.shareRate,
                                shareSuccessTime: t.shareTime
                            });
                        }), f.log("RewardConfig ServerData is ", f.Info.rewardConfigOriginData), o()) : f.error("load reward config error ", t);
                    }
                });
        }, f.setOpenId = c, f.exit = function() {
            f.PA.exitMiniProgram();
        }, f.rewardOperation = function(e) {
            console.log('ga 视频广告')
            if (e.byVideo){

                Adv_skd.default.instance.showVideo(()=>{
                    const f = {
                        reward: !0
                    };
                    e.result(f);

                },()=>{
                    const f = {
                        reward: !1
                    };
                    e.result(f);
                });

                // if (f.Info.withoutRewardVideoAd) {
                //     console.log('ga 视频广告1')
                //     const f = {
                //         reward: !0
                //     };
                //     e.result(f);
                // } else{
                //     console.log('ga 视频广告2')
                //     f.showVideoAd(e);
                // }
            }else{
                u({
                    tag: e.tag,
                    page: e.page,
                    result: t => {
                        if (null != t && t.reward) {
                            f.Info.rewardUserData.data.has(e.tag) && f.Info.rewardUserData.data.get(e.tag).currCount++;
                            const t = {
                                reward: !0
                            };
                            e.result(t);
                        } else {
                            const f = {
                                reward: !1
                            };
                            e.result(f);
                        }
                    }
                });
            } 
        }, f.randomShare = u, f.getOpenId = function e(o, n, t) {
            var a;
            let i = (t, e) => {
                f.Info.openId = t, f.Info.session_key = e, f.Info.openId && "" != f.Info.openId && (f.sentLogs([{
                    eventId: "GotOpenId",
                    extraNum: 0,
                    detail: JSON.stringify({
                        channel: f.Info.channelId,
                        version: f.Info.version,
                        appVersion: f.PA.getSystemInfoSync().version
                    })
                }, {
                    eventId: "LaunchScene",
                    extraNum: 0,
                    detail: JSON.stringify({
                        scene: f.Info.sceneWithSourceAppId
                    })
                }])), o(t, e);
            };
            if (f.Info.isPreview) try {
                f.Info.openId = localStorage.getItem("user_id"), f.Info.openId || (f.Info.openId = "Test" + Date.now() + (1e8 * Math.random()).toFixed(),
                    localStorage.setItem("user_id", f.Info.openId)), i(f.Info.openId, "TestSessionKey");
            } catch (t) {
                console.error(t);
            } else f.isPlatform(f.Platform.Kuaidianwan) ? GameAssistantWeb.login((t, e) => {
                f.Info.openId = e, i(e, "");
            }) : (a = null !== (a = f.PA.getStorageSync("LocalOpenId")) && void 0 !== a ? a : "") && !t && f.isPlatform([f.Platform.WeChat]) ? i(a, "") : f.isPlatform(f.Platform.M4399MiniGame) ? window.h5api.isLogin() ? window.h5api.login(t => {
                f.Info.uid = parseInt(t.uId), f.Info.nickname = t.userName, i(t.uId, "");
            }) : i("LocalOpenId", "") : f.PA.login({
                force: !1,
                success: e => {
                    console.log("Platform " + f.Info.platform + " login:" + JSON.stringify(e));
                    let o = f.PA.getSystemInfoSync();
                    if (f.isPlatform(f.Platform.Kwaigame)) i(e.gameUserId, e.gameToken);
                    else {
                        let t = {};
                        if (f.isPlatform([f.Platform.ByteDance])) {
                            const f = {};
                            f.code = e.code, f.anonymous_code = e.anonymousCode, t = f;
                        } else if (f.isPlatform([f.Platform.LianShangMiniGame, f.Platform.Android, f.Platform.iOS])) {
                            const f = {};
                            f.code = e.code, t = f;
                        } else if (f.isPlatform(f.Platform.OPPO)) {
                            f.Info.nickname = e.nickName, f.Info.avatar = e.avatar, f.Info.token = e.token;
                            const o = {};
                            o.code = e.uid, t = o;
                        } else if (f.isPlatform(f.Platform.Vivo)) {
                            f.Info.token = e.code;
                            const o = {};
                            o.token = e.code, t = o;
                        } else if (f.isPlatform(f.Platform.Hago)) {
                            console.log("systemInfo:", JSON.stringify(o));
                            const f = {};
                            f.code = e.code, f.countryCode = o.countryCode, t = f;
                        } else {
                            const f = {};
                            f.js_code = e.code, t = f;
                        }! function s(r, l, d) {
                            var t;
                            if (f.isPlatform([f.Platform.Android, f.Platform.OPPO, f.Platform.iOS])) try {
                                d(l.code, "");
                            } catch (t) {} else {
                                let o = "";
                                l.code = null !== (t = l.code) && void 0 !== t ? t : "", Object.getOwnPropertyNames(l).forEach((t, e) => {
                                    o += (0 == e ? "?" : "&") + t + "=" + l[t];
                                }), console.log("GetOpenIdUrl:", f.Urls.GetOpenId + o), f.request({
                                    url: f.Urls.GetOpenId + o,
                                    method: "GET",
                                    success: t => {
                                        var e, o, n, a, i;
                                        if (console.log("GetOpenid:", JSON.stringify(t)), null !== (e = null == t ? void 0 : t.data) && void 0 !== e && e.openid ? f.Info.openId = null === (o = null == t ? void 0 : t.data) || void 0 === o ? void 0 : o.openid : null !== (o = null === (o = t.data) || void 0 === o ? void 0 : o.data) && void 0 !== o && o.open_id ? f.Info.openId = null === (n = null === (n = t.data) || void 0 === n ? void 0 : n.data) || void 0 === n ? void 0 : n.open_id : null !== (n = t.data) && void 0 !== n && n.anonymous_openid ? f.Info.openId = null === (n = t.data) || void 0 === n ? void 0 : n.anonymous_openid : null !== (a = null === (a = null == t ? void 0 : t.data) || void 0 === a ? void 0 : a.data) && void 0 !== a && a.openId && (f.Info.openId = t.data.data.openId),
                                            null !== (a = null === (a = null == t ? void 0 : t.data) || void 0 === a ? void 0 : a.data) && void 0 !== a && a.nickName && (f.Info.nickname = t.data.data.nickName),
                                            "" != f.Info.openId) {
                                            c(f.Info.openId);
                                            try {
                                                d(f.Info.openId, null === (i = t.data) || void 0 === i ? void 0 : i.session_key);
                                            } catch (t) {}
                                        } else r ? f.PA.showModal({
                                            title: "提示",
                                            content: "获取登录数据失败(数据异常)，点击重试",
                                            showCancel: !1,
                                            confirmText: "重试",
                                            success: () => {
                                                s(r, l, d);
                                            }
                                        }) : d("", "");
                                    },
                                    fail: () => {
                                        r ? f.PA.showModal({
                                            title: "提示",
                                            content: "获取登录数据失败(请求失败)，点击重试",
                                            showCancel: !1,
                                            confirmText: "重试",
                                            success: () => {
                                                s(r, l, d);
                                            }
                                        }) : d("", "");
                                    }
                                });
                            }
                        }(n, t, i);
                    }
                },
                fail: t => {
                    console.log(t), f.PA.showModal({
                        title: "提示",
                        content: "获取登录数据失败(平台授权失败)，点击重试",
                        showCancel: !1,
                        confirmText: "重试",
                        success: () => {
                            e(o);
                        }
                    });
                }
            });
        }, f.isNextRewardVideo = function(o) {
            let n = !0;
            try {
                if (!f.Info.underCheck) {
                    let t = f.Info.rewardConfigOriginData.get(o);
                    (null == t || t.rule.length <= 0) && (t = f.Info.rewardConfigOriginData.get("SCORE_STRATEGY"));
                    let e = f.Info.rewardUserData.data.get(o);
                    for (null == e && (e = f.Info.rewardUserData.data.get("SCORE_STRATEGY")); e.currCount >= t.rule[e.currIndex].count;)
                        if (e.currIndex += 1,
                            e.currCount = 0, e.currIndex >= t.rule.length) {
                            e.currIndex = 0, e.currCount = 0;
                            break;
                        }
                    n = "video" == t.rule[e.currIndex].type;
                }
            } catch (t) {
                n = !0;
            }
            return n;
        }, f.loadRewardUserLocalData = o, f.getNavigationList = function(t, n, a) {
            return new Promise((e, o) => {
                f.request({
                    url: f.Urls.GetNativationConfig,
                    method: "POST",
                    data: {
                        userId: f.Info.uid,
                        type: t,
                        num: n,
                        excludes: a
                    },
                    success: t => {
                        if (0 == t.data.code) {
                            let o = [];
                            t.data.data.forEach(t => {
                                const e = {};
                                e.id = t.redirectId, e.appid = t.appid, e.name = t.name, e.is_open_code = !1, e.path = t.path,
                                    e.icon = t.icon, e.qr_code = "", o.push(e);
                            }), e(o);
                        } else o(t);
                    },
                    fail: t => {
                        o(t);
                    }
                });
            });
        }, f.enterPage = function(t) {
            const e = {};
            e.page = t.page, e.time = 0, f.Info.pageList.push(e);
            const o = {};
            o.page = t.page, o.existRedirect = t.existRedirect ? 1 : 0, o.existVideo = t.existVideo ? 1 : 0,
                o.existBanner = t.existBanner ? 1 : 0, o.openType = null !== (t = t.openType) && void 0 !== t ? t : 0,
                t = o, f.sentLog("EnterPage", void 0, t);
        }, f.closePage = function(t) {
            var e = function(e) {
                for (let t = 0; t < f.Info.pageList.length; t++)
                    if (f.Info.pageList[t].page == e) {
                        var o = f.Info.pageList[t];
                        return f.Info.pageList.splice(t, 1), o;
                    }
                return null;
            }(t.page);
            if (e) {
                const o = {};
                o.page = t.page, f.sentLog("ClosePage", e.time, o);
            }
        }, f.videoRequestEvent = function(o, t) {
            o || console.error("pageName is empty!");
            let n = [];
            t.forEach(t => {
                const e = {};
                e.page = o, e.type = t, n.push({
                    eventId: "VideoRequest",
                    detail: JSON.stringify(e)
                });
            }), t = n, f.sentLogs(t);
        }, f.clickEvent = function(a, i, s, r) {
            if (f.Info.pageList && 0 < f.Info.pageList.length) {
                a || console.error("pageName is empty!");
                let t = i,
                    e = f.Info.pageList[f.Info.pageList.length - 1],
                    o = !1;
                e.map ? e.map.get(s) || (e.map.set(s, 1), o = !0) : (e.map = new Map(), e.map.set(s, 1),
                    o = !0);
                var l = "video" == s ? t : null,
                    d = "other" != s ? e.time : 0;
                const c = {};
                c.page = a, c.eventType = "click", c.posType = s, c.pos = l, c.isFirstClick = o ? 1 : 0;
                let n = c;
                r && (n.classify = r), f.sentLog(i, d, n);
            }
        }, f.isDefault = function() {
            return f.isPlatform(f.Platform.Default);
        }, f.isWeChat = function() {
            return f.isPlatform(f.Platform.WeChat);
        }, f.isQQ = function() {
            return f.isPlatform(f.Platform.QQ);
        }, f.isOPPO = function() {
            return f.isPlatform(f.Platform.OPPO);
        }, f.isVivo = function() {
            return f.isPlatform(f.Platform.Vivo);
        }, f.isKuaiDianWan = function() {
            return f.isPlatform(f.Platform.Kuaidianwan);
        }, f.isQuTouTiao = function() {
            return f.isPlatform(f.Platform.QuTouTiao);
        }, f.isQuTouTiaoAndroid = function() {
            return f.isPlatform(f.Platform.QuTouTiaoAndroid);
        }, f.isByteDance = function() {
            return f.isPlatform(f.Platform.ByteDance);
        }, f.isYueYou = function() {
            return f.isPlatform(f.Platform.YueYou);
        }, f.isKuaiKan = function() {
            return f.isPlatform(f.Platform.KuaiKan);
        }, f.isBaoQu = function() {
            return f.isPlatform(f.Platform.BaoQu);
        }, f.isAndroid = function() {
            return f.isPlatform(f.Platform.Android);
        }, f.isiOS = function() {
            return f.isPlatform(f.Platform.iOS);
        }, f.isUCMiniGame = function() {
            return f.isPlatform(f.Platform.UCMiniGame);
        }, f.isLianShangMiniGame = function() {
            return f.isPlatform(f.Platform.LianShangMiniGame);
        }, f.isKwaigame = function() {
            return f.isPlatform(f.Platform.Kwaigame);
        }, f.isM4399MiniGame = function() {
            return f.isPlatform(f.Platform.M4399MiniGame);
        }, f.isNative = function() {
            return f.isPlatform(f.Platform.iOS) || f.isPlatform(f.Platform.Android);
        }, f.isOppoAndroid = function() {
            return f.isPlatform(f.Platform.Android) && f.Info.distributionChannel == f.DistributionChannel.OPPO;
        };
    }(g = g || {}), (t = g = g || {}).PAClass = class {
        constructor() {
            this.platformObject = null, this.launchOptions = null, this.selfShowToast = null;
        }
        init(t) {
            null == t && console.log("GA PlatformApi init error: platformObject is null"), this.syncUnsupportMethod(t),
                this.platformObject = t;
        }
        syncUnsupportMethod(o) {
            try {
                let e = [];
                if (t.Info.isPreview || t.isPlatform([t.Platform.Kuaidianwan, t.Platform.M4399MiniGame, t.Platform.Hago])) e.push("getSetting", "showLoading", "hideLoading", "createUserInfoButton", "getUpdateManager", "onTouchEnd", "onTouchStart", "offTouchStart", "offTouchEnd", "setKeepScreenOn", "showShareMenu", "loadSubpackage", "onShareMessageToFriend", "onShareAppMessage", "saveAppToDesktop", "initGameBannerAd", "addColorSign", "addRecentColorSign", "subscribeAppMsg", "onShareTimeline", "vibrateShort", "vibrateLong");
                else if (t.isPlatform([t.Platform.Android, t.Platform.iOS])) Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(e => {
                    null == this[e] && (this[e] = (...t) => o[e](...t));
                }), Object.getOwnPropertyNames(o).forEach(e => {
                    null == this[e] && "function" == typeof o[e] && (this[e] = (...t) => o[e](...t));
                });
                else if (o)
                    for (var n in e.push("showNativeAd", "hideNativeAd"), o) null == this[n] && (this[n] = o[n]);
                e.forEach(t => {
                    this[t] = () => {
                        console.log("Preview 暂不支持！" + t);
						if(t == "vibrateShort")
						{
							//console.log(""+dddd)
						}
                    };
                });
            } catch (t) {
                console.error(t);
            }
        }
        addUnsupportMethods(e, o) {
            t.isPlatform(e) && o.forEach(t => {
                this[t] = () => {
                    console.log(e + " 暂不支持" + t);
                };
            });
        }
        onShow(e) {
            var o;
            t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? (null !== (o = cc.game) && void 0 !== o && o.EVENT_SHOW && cc.game.on(cc.game.EVENT_SHOW, e),
                null !== (o = cc.Game) && void 0 !== o && o.EVENT_SHOW && cc.game.on(cc.Game.EVENT_SHOW, e)) : t.log("laya onShow 暂未实现") : (t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb : this.platformObject).onShow(e);
        }
        offShow(e) {
            var o;
            t.isPlatform([t.Platform.Android, t.Platform.iOS]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? (null !== (o = cc.game) && void 0 !== o && o.EVENT_SHOW && cc.game.off(cc.game.EVENT_SHOW, e),
                null !== (o = cc.Game) && void 0 !== o && o.EVENT_SHOW && cc.game.off(cc.Game.EVENT_SHOW, e)) : t.log("laya offShow 暂未实现") : (t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb : this.platformObject).offShow(e);
        }
        onHide(e) {
            var o;
            t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? (null !== (o = cc.game) && void 0 !== o && o.EVENT_HIDE && cc.game.on(cc.game.EVENT_HIDE, e),
                null !== (o = cc.Game) && void 0 !== o && o.EVENT_HIDE && cc.game.on(cc.Game.EVENT_HIDE, e)) : t.log("laya onhide 暂未实现") : (t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb : this.platformObject).onHide(e);
        }
        offHide(e) {
            var o;
            t.isPlatform([t.Platform.Android, t.Platform.iOS]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? (null !== (o = cc.game) && void 0 !== o && o.EVENT_HIDE && cc.game.off(cc.game.EVENT_HIDE, e),
                null !== (o = cc.Game) && void 0 !== o && o.EVENT_HIDE && cc.game.off(cc.Game.EVENT_HIDE, e)) : t.log("laya offHide 暂未实现") : (t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb : this.platformObject).offHide(e);
        }
        getLaunchOptionsSync() {
            if (t.Info.isPreview || t.isPlatform([t.Platform.M4399MiniGame, t.Platform.Kuaidianwan, t.Platform.Hago])) {
                const e = {
                        appId: "",
                        extraData: {}
                    },
                    t = {
                        path: "",
                        query: {}
                    };
                return t.referrerInfo = e, t.scene = 0, t.shareTicket = "", t;
            }
            return this.launchOptions && 0 != Object.keys(this.launchOptions).length ? this.launchOptions : this.launchOptions = this.platformObject.getLaunchOptionsSync();
        }
        getSystemInfoSync() {
            return null == t.Info.systemInfo && (t.Info.isPreview || t.isPlatform([t.Platform.M4399MiniGame, t.Platform.Kuaidianwan]) ? t.Info.systemInfo = {
                    SDKVersion: "",
                    albumAuthorized: !1,
                    benchmarkLevel: 100,
                    bluetoothEnabled: !1,
                    brand: "Browser",
                    cameraAuthorized: !1,
                    fontSizeSetting: 0,
                    language: "zh-cn",
                    locationAuthorized: !1,
                    locationEnabled: !1,
                    microphoneAuthorized: !1,
                    model: "Browser",
                    notificationAlertAuthorized: !1,
                    notificationAuthorized: !1,
                    notificationBadgeAuthorized: !1,
                    notificationSoundAuthorized: !1,
                    pixelRatio: 1,
                    platform: "Browser",
                    screenHeight: t.Info.resolution.height,
                    screenWidth: t.Info.resolution.width,
                    statusBarHeight: 0,
                    system: "iOS",
                    version: "",
                    wifiEnabled: !1,
                    windowHeight: t.Info.resolution.height,
                    windowWidth: t.Info.resolution.width,
                    designPixelRatio: 1,
                    appName: "",
                    safeArea: {
                        left: 0,
                        right: 0,
                        top: 0,
                        bottom: 0,
                        width: t.Info.resolution.width,
                        height: t.Info.resolution.height
                    }
                } : t.Info.systemInfo = this.platformObject.getSystemInfoSync(), t.Info.systemInfo.windowHeight / t.Info.systemInfo.windowWidth < 1.5 ? t.Info.systemInfo.designPixelRatio = t.Info.resolution.height / t.Info.systemInfo.windowHeight : t.Info.systemInfo.designPixelRatio = t.Info.resolution.width / t.Info.systemInfo.windowWidth),
                t.Info.systemInfo;
        }
        exitMiniProgram() {
            var e;
            try {
                (null !== (e = this.platformObject.exitMiniProgram) && void 0 !== e ? e : this.platformObject.exitApplication)();
            } catch (e) {
                t.error(e);
            }
        }
        loadSubpackage(e) {
            return this.platformObject && this.platformObject.loadSubpackage ? this.platformObject.loadSubpackage(e) : (t.UnsupportLog("loadSubpackage"),
                null);
        }
        createRewardedVideoAd(e) {
            return t.isPlatform(t.Platform.Vivo) && (e.posId = e.adUnitId), this.platformObject.createRewardedVideoAd(e);
        }
        createInterstitialAd(e) {
            return t.isPlatform(t.Platform.OPPO) ? this.platformObject.createInsertAd(e) : (t.isPlatform(t.Platform.Vivo) && (e.posId = e.adUnitId),
                this.platformObject.createInterstitialAd(e));
        }
        saveAppToDesktop(e) {
            t.isPlatform(t.Platform.QQ) && this.platformObject.saveAppToDesktop(e);
        }
        addColorSign(e) {
            t.isPlatform(t.Platform.QQ) && this.platformObject.addColorSign(e);
        }
        addRecentColorSign(e) {
            t.isPlatform(t.Platform.QQ) && this.platformObject.addRecentColorSign(e);
        }
        isColorSignExistSync() {
            return !!t.isPlatform(t.Platform.QQ) && this.platformObject.isColorSignExistSync();
        }
        getLanguage() {
            return this.platformObject.getLanguage ? this.platformObject.getLanguage() : "zh-CN";
        }
        initGameBannerAd(n, a, i = !0, s) {
            if (t.isPlatform(t.Platform.OPPO)) {
                let e, o = this.platformObject.getSystemInfoSync().platformVersionCode;
                if (s || (s = {
                        left: 100 / this.getSystemInfoSync().designPixelRatio,
                        top: (t.Info.resolution.height - 200) / this.getSystemInfoSync().designPixelRatio,
                        orientation: "horizontal"
                    }), 1090 <= o && !i && a) {
                    const n = {};
                    n.adUnitId = a, n.style = s, e = this.platformObject.createGameBannerAd(n);
                } else if (1076 <= o) {
                    const t = {};
                    t.adUnitId = n, e = this.platformObject.createGameBannerAd(t);
                }
                return e;
            }
        }
        showInterstitialAd() {
            (t.isPlatform(t.Platform.Android) || t.isPlatform(t.Platform.iOS)) && this.platformObject.showInterstitialAd();
        }
        setShowToast(t) {
            this.selfShowToast = t;
        }
        showToast(e) {
            if (t.Info.isPreview || t.isPlatform([t.Platform.M4399MiniGame, t.Platform.Hago])) t.log("showToast:", e.title);
            else if (this.selfShowToast) this.selfShowToast(e);
            else if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                t.message = e.title, t.duration = e.duration, this.platformObject.showToast(t);
            } else t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb.showToast(e.title) : this.platformObject.showToast(e);
        }
        showModal(n) {
            var e;
            if (t.Info.isPreview || t.isPlatform([t.Platform.M4399MiniGame, t.Platform.Hago])) t.log("showModal:" + n.content),
                n.success({
                    confirm: !1 === n.showCancel,
                    cancel: 0 != n.showCancel
                });
            else {
                if (t.isPlatform(t.Platform.Vivo)) {
                    let t = [];
                    const o = {};
                    if (o.text = null !== (e = n.confirmText) && void 0 !== e ? e : "确定", o.color = n.confirmColor,
                        t.push(o), n.showCancel) {
                        const a = {};
                        a.text = null !== (e = n.cancelText) && void 0 !== e ? e : "取消", a.color = n.cancelColor,
                            t.push(a);
                    }
                    return this.platformObject.showDialog({
                        title: n.title,
                        message: n.content,
                        buttons: t,
                        success: t => {
                            if (0 == t.index) {
                                const t = {
                                    confirm: !0,
                                    cancel: !1
                                };
                                n.success(t);
                            } else if (1 == t.index) {
                                const t = {
                                    confirm: !1,
                                    cancel: !0
                                };
                                n.success(t);
                            } else {
                                const t = {
                                    confirm: !1,
                                    cancel: !1
                                };
                                n.success(t);
                            }
                        },
                        cancel: n.fail,
                        complete: n.complete
                    });
                }
                if (!t.isPlatform(t.Platform.Kuaidianwan)) return this.platformObject.showModal(n);
                GameAssistantWeb.showModal(n.title, n.content, n.confirmText, n.cancelText, (t, e) => {
                    const o = {};
                    o.confirm = t, o.cancel = e, n.success(o);
                });
            }
        }
        showLoading(e) {
            if (!t.isPlatform(t.Platform.Vivo)) return this.platformObject.showLoading(e); {
                const t = {};
                t.message = e.title, t.success = e.success, t.cancel = e.fail, t.complete = e.complete,
                    this.platformObject.showLoading(t);
            }
        }
        getMenuButtonBoundingClientRect() {
            var e;
            return t.isPlatform(t.Platform.OPPO) ? {
                top: this.getSystemInfoSync().statusBarHeight,
                left: 0,
                right: 0,
                bottom: 0,
                width: 0,
                height: 0
            } : null !== (e = this.platformObject) && void 0 !== e && e.getMenuButtonBoundingClientRect ? this.platformObject.getMenuButtonBoundingClientRect() : {
                top: 0,
                left: 0,
                right: 0,
                bottom: 0,
                width: 0,
                height: 0
            };
        }
        shareAppMessage(e) {
            if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                return t.success = e.success, t.fail = e.fail, t.cancel = e.fail, this.platformObject.share(t);
            }
            return e.extra && (e.extra.hashtag_list && null == e.extra.videoTopics ? e.extra.videoTopics = e.extra.hashtag_list : e.extra.videoTopics && null == e.extra.hashtag_list && (e.extra.hashtag_list = e.extra.videoTopics)),
                this.platformObject.shareAppMessage(e);
        }
        setStorageSync(e, o) {
            if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                t.key = e, t.value = o, this.platformObject.setStorageSync(t);
            } else t.isPlatform(t.Platform.OPPO) ? localStorage.setItem(e, o) : t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? cc.sys.localStorage.setItem(e, o) : t.isEngine(t.EngineType.LayaAir) && localStorage.setItem(e, o) : t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb.setStorage(e, o) : this.platformObject.setStorageSync(e, o);
        }
        setStorage(e) {
            var o;
            if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                return t.key = e.key, t.value = e.data, t.success = e.success, t.fail = e.fail,
                    t.complete = e.complete, this.platformObject.setStorage(t);
            }
            if (t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview) {
                if (t.isEngine(t.EngineType.CocosCreator)) {
                    cc.sys.localStorage.setItem(e.key, e.data);
                    try {
                        e.success();
                    } catch (t) {}
                } else if (t.isEngine(t.EngineType.LayaAir)) {
                    localStorage.setItem(e.key, e.data);
                    try {
                        e.success();
                    } catch (t) {}
                }
            } else {
                if (!t.isPlatform(t.Platform.Kuaidianwan)) return this.platformObject.setStorage(e);
                GameAssistantWeb.setStorage(e.key, e.data), null === (o = e.success) || void 0 === o || o.call(e);
            }
        }
        removeStorageSync(e) {
            if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                return t.key = e, this.platformObject.deleteStorageSync(t);
            }
            if (t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview) t.isEngine(t.EngineType.CocosCreator) ? cc.sys.localStorage.removeItem(e) : t.isEngine(t.EngineType.LayaAir) && localStorage.removeItem(e);
            else {
                if (!t.isPlatform(t.Platform.Kuaidianwan)) return this.platformObject.removeStorageSync(e);
                GameAssistantWeb.removeStorage(e);
            }
        }
        removeStorage(e) {
            var o;
            if (t.isPlatform(t.Platform.Vivo)) return this.platformObject.deleteStorage(e);
            if (t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview) {
                if (t.isEngine(t.EngineType.CocosCreator)) {
                    cc.sys.localStorage.removeItem(e.key);
                    try {
                        e.success();
                    } catch (t) {}
                } else if (t.isEngine(t.EngineType.LayaAir)) {
                    localStorage.removeItem(e.key);
                    try {
                        e.success();
                    } catch (t) {}
                }
            } else {
                if (!t.isPlatform(t.Platform.Kuaidianwan)) return this.platformObject.removeStorage(e);
                GameAssistantWeb.removeStorage(e.key), null === (o = e.success) || void 0 === o || o.call(e);
            }
        }
        getStorageSync(e) {
            if (t.isPlatform(t.Platform.Vivo)) {
                const t = {};
                return t.key = e, this.platformObject.getStorageSync(t);
            }
            return t.isPlatform(t.Platform.OPPO) ? localStorage.getItem(e) : t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview ? t.isEngine(t.EngineType.CocosCreator) ? cc.sys.localStorage.getItem(e) : t.isEngine(t.EngineType.LayaAir) ? localStorage.getItem(e) : void 0 : t.isPlatform(t.Platform.Kuaidianwan) ? GameAssistantWeb.getStorage(e) : t.isPlatform(t.Platform.Hago) ? null : this.platformObject.getStorageSync(e);
        }
        getStorage(e) {
            var o;
            if (this.platformObject.getStorage) return this.platformObject.getStorage(e);
            if (t.isPlatform([t.Platform.Android, t.Platform.iOS, t.Platform.M4399MiniGame, t.Platform.Hago]) || t.Info.isPreview) {
                if (t.isEngine(t.EngineType.CocosCreator)) try {
                    e.success(cc.sys.localStorage.getItem(e.key));
                } catch (t) {} else if (t.isEngine(t.EngineType.LayaAir)) try {
                    e.success(localStorage.getItem(e.key));
                } catch (t) {}
            } else if (t.isPlatform(t.Platform.Kuaidianwan)) null === (o = e.success) || void 0 === o || o.call(e, GameAssistantWeb.getStorage(e.key));
            else try {
                e.success("");
            } catch (t) {}
        }
        navigateToMiniProgram(t) {
            var e;
            t.pkgName = null !== (e = t.pkgName) && void 0 !== e ? e : t.appId, (null !== (e = this.platformObject.navigateToMiniGame) && void 0 !== e ? e : this.platformObject.navigateToMiniProgram)(t);
        }
        getUserInfo(n) {
            return t.isPlatform(t.Platform.Vivo) ? this.platformObject.getUserInfo({
                success: t => {
                    try {
                        const e = {};
                        e.nickName = t.data.nickName, e.avatarUrl = t.data.biggerAvatar, e.gender = 1 == t.data.gender ? "1" : 2 == t.data.gender ? "2" : "0",
                            e.country = "", e.province = "", e.city = "", e.language = "zh_CN";
                        const o = {};
                        o.userInfo = e, o.rawData = "", o.signature = "", o.encryptedData = "", o.iv = "",
                            o.cloudID = "", n.success(o);
                    } catch (t) {
                        console.error(t);
                    }
                },
                fail: n.fail
            }) : this.platformObject.getUserInfo(n);
        }
        login(o) {
            return t.isPlatform(t.Platform.Vivo) ? this.platformObject.login({
                success: t => {
                    try {
                        const e = {};
                        e.code = t.data.token, o.success(e);
                    } catch (t) {
                        console.error(t);
                    }
                },
                fail: o.fail
            }) : t.isPlatform(t.Platform.QuTouTiao) ? this.platformObject.qttlogin(o) : this.platformObject.login(o);
        }
        checkIsUserAdvisedToRest(e) {
            t.isPlatform(t.Platform.WeChat) && this.platformObject.checkIsUserAdvisedToRest({
                todayPlayedTime: e,
                success: t => {
                    t.result && this.showModal({
                        title: "防沉迷提示",
                        content: "你今日的游戏在线时长已达上限，或当前时段为未成年登陆限制时间段，您将无法继续游戏。",
                        showCancel: !1,
                        confirmText: "退出游戏",
                        success: () => {
                            this.exitMiniProgram();
                        }
                    });
                }
            });
        }
        setOrientation(e) {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.setOrientation(e);
        }
        setFullScreen(e) {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.setFullScreen(e);
        }
        initYueYou() {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.init();
        }
        getAuthCode(e, o, n) {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.getAuthCode(e, o, n);
        }
        openGameAd(e, o, n, a, i, s) {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.openGameAd(e, o, n, a, i, s);
        }
        addViewStateListener(e) {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.addViewStateListener(e);
        }
        removeViewStateListener() {
            t.isPlatform(t.Platform.YueYou) && Yzsdk.removeViewStateListener();
        }
        screenWidth() {
            return t.isPlatform(t.Platform.YueYou) ? Yzsdk.screenWidth() : 0;
        }
        screenHeight() {
            return t.isPlatform(t.Platform.YueYou) ? Yzsdk.screenHeight() : 0;
        }
        joinVoIPChat(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.joinVoIPChat ? wx.joinVoIPChat(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.joinVoIPChat && qg.joinVoIPChat(e);
        }
        exitVoIPChat(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.exitVoIPChat ? wx.exitVoIPChat(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.exitVoIPChat && qg.exitVoIPChat(e);
        }
        updateVoIPChatMuteConfig(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.updateVoIPChatMuteConfig ? wx.updateVoIPChatMuteConfig(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.updateVoIPChatMuteConfig && qg.updateVoIPChatMuteConfig(e);
        }
        onVoIPChatSpeakersChanged(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.onVoIPChatSpeakersChanged ? wx.onVoIPChatSpeakersChanged(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.onVoIPChatSpeakersChanged && qg.onVoIPChatSpeakersChanged(e);
        }
        onVoIPChatMembersChanged(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.onVoIPChatMembersChanged ? wx.onVoIPChatMembersChanged(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.onVoIPChatMembersChanged && qg.onVoIPChatMembersChanged(e);
        }
        onVoIPChatInterrupted(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.onVoIPChatInterrupted ? wx.onVoIPChatInterrupted(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.onVoIPChatInterrupted && qg.onVoIPChatInterrupted(e);
        }
        offVoIPChatSpeakersChanged(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.offVoIPChatSpeakersChanged ? wx.offVoIPChatSpeakersChanged(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.offVoIPChatSpeakersChanged && qg.offVoIPChatSpeakersChanged(e);
        }
        offVoIPChatMembersChanged(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.offVoIPChatMembersChanged ? wx.offVoIPChatMembersChanged(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.offVoIPChatMembersChanged && qg.offVoIPChatMembersChanged(e);
        }
        offVoIPChatInterrupted(e) {
            t.isPlatform(t.Platform.WeChat) && null !== wx && void 0 !== wx && wx.offVoIPChatInterrupted ? wx.offVoIPChatInterrupted(e) : t.isPlatform(t.Platform.OPPO) && null !== qg && void 0 !== qg && qg.offVoIPChatInterrupted && qg.offVoIPChatInterrupted(e);
        }
        isRewardVideoAdReady() {
            return !!t.isPlatform([t.Platform.iOS, t.Platform.Android]) && this.platformObject.isRewardVideoAdReady();
        }
    },
    function(t) {
        class e {
            constructor(t) {
                this.seed = t, this.seed || 0 == this.seed || (this.seed = new Date().getTime());
            }
            get value() {
                return this.range(0, 1);
            }
            range(t, e) {
                return e <= t ? t : (this.seed || 0 == this.seed || (this.seed = new Date().getTime()),
                    e = e || 1, t = t || 0, this.seed = (9301 * this.seed + 49297) % 233280, t + this.seed / 233280 * (e - t));
            }
            rangeInt(t, e) {
                if (e <= t) return t;
                if (233280 <= e - t) return 0;
                this.seed || 0 == this.seed || (this.seed = new Date().getTime()), e = e || 1, t = t || 0,
                    this.seed = (9301 * this.seed + 49297) % 233280;
                var o = this.seed / 233280;
                return t + Math.floor(o * (e - t + .9));
            }
            static get internalInstance() {
                return null == this._internalInstance && (this._internalInstance = new e()), this._internalInstance;
            }
            static get value() {
                return this.internalInstance.range(0, 1);
            }
            static range(t, e) {
                return this.internalInstance.range(t, e);
            }
            static rangeInt(t, e) {
                return this.internalInstance.rangeInt(t, e);
            }
        }
        e._internalInstance = null, t.Random = e;
    }(g = g || {}),
    function(i) {
        function o(t) {
            return t instanceof Array ? 0 <= t.indexOf(i.Info.platform) : i.Info.platform == t;
        }

        function t(t) {
            return t instanceof Array ? 0 <= t.indexOf(i.Info.distributionChannel) : i.Info.distributionChannel == t;
        }

        function e(t) {
            return t instanceof Array ? 0 <= t.indexOf(i.Info.engine) : i.Info.engine == t;
        }

        function n(...t) {
            i.Info.debugLog && (e(i.EngineType.LayaAir) && o([i.Platform.iOS, i.Platform.Android]) ? console.log("GA:" + t.join(",")) : console.log("GA:", ...t));
        }

        function s(...t) {
            e(i.EngineType.LayaAir) && o([i.Platform.iOS, i.Platform.Android]) ? console.warn("GA:" + t.join(",")) : console.warn("GA:", ...t);
        }

        function r(a) {
            if (!o(i.Platform.M4399MiniGame) && !t(i.DistributionChannel.GooglePlay)) {
                if (i.PA && i.PA.request && !o([i.Platform.Vivo, i.Platform.Hago])) {
                    const o = {};
                    return o.appid = i.Info.appId, a.header = o, i.PA.request(a);
                } {
                    let n = new XMLHttpRequest();
                    n.onreadystatechange = function() {
                            if (4 == n.readyState) {
                                let t = n.responseText,
                                    e = {
                                        data: "",
                                        statusCode: n.status,
                                        header: {},
                                        errMsg: n.getAllResponseHeaders()
                                    };
                                try {
                                    var o = JSON.parse(t);
                                    e.data = o;
                                } catch (t) {
                                    e.data = n.responseText;
                                }
                                200 <= n.status && n.status < 400 ? "function" == typeof a.success && a.success(e) : (s('request fail with url : "' + a.url + '"'),
                                    "function" == typeof a.fail && a.fail(e));
                            }
                        }, n.onerror = function() {
                            a.fail && a.fail({
                                errMsg: "request onerror"
                            });
                        }, n.onabort = function() {
                            a.fail && a.fail({
                                errMsg: "request onabort"
                            });
                        }, void 0 === a.method && (a.method = "GET"), n.open(a.method, a.url, !0), o(i.Platform.Hago) ? n.setRequestHeader("Content-Type", "application/json;charset=utf-8") : n.setRequestHeader("Content-type", "application/json;charset=utf-8"),
                        n.setRequestHeader("appid", i.Info.appId), void 0 === a.data ? n.send() : n.send(JSON.stringify(a.data));
                }
            }
        }

        function a(t, e) {
            // "onlinetime" != t[0].eventId && n("sentLogs:" + JSON.stringify(t)), t.forEach(e => {
            //     if (null != e.extraNum) try {
            //         let t = null != e.detail ? JSON.parse(e.detail) : {};
            //         t.extraNum = e.extraNum, e.detail = JSON.stringify(t);
            //     } catch (t) {}
            // }), i.request({
            //     url: i.Urls.SaveLog,
            //     data: {
            //         appid: i.Info.appId,
            //         uuid: i.Info.openId,
            //         list: t,
            //         channel: i.Info.channelId,
            //         device: i.PA.getSystemInfoSync().model
            //     },
            //     method: "POST",
            //     success: () => {
            //         try {
            //             e();
            //         } catch (t) {}
            //     }
            // }), (o([i.Platform.Android]) || o(i.Platform.iOS)) && t.forEach(t => {
            //     var e;
            //     if ("onlinetime" != t.eventId) try {
            //         h.PROXY.sendEvent(t.eventId, null !== (e = t.detail) && void 0 !== e ? e : "{}");
            //     } catch (t) {
            //         console.error(t);
            //     }
            // });
        }
        i.isPlatform = o, i.isDistributionChannel = t, i.isEngine = e, i.log = n, i.warn = s,
            i.error = function(...t) {
                e(i.EngineType.LayaAir) && o([i.Platform.iOS, i.Platform.Android]) ? console.error("GA:" + t.join(",")) : console.error("GA:", ...t);
            }, i.UnsupportLog = function(t) {
                s("当前平台 " + i.Info.platform + " 暂不支持 " + t);
            }, i.request = r, i.sentLogs = a, i.sentLog = function(t, e, o, n) {
                // a([ {
                //     eventId: t,
                //     detail: o ? JSON.stringify(o) : "",
                //     extraNum: e || 0
                // } ], n);
            }, i.betweenNum = function(t, e, o) {
                return Math.min(o, Math.max(e, t));
            }, i.isiPhoneX = function() {
                let t = i.PA.getSystemInfoSync().model;
                return -1 != t.indexOf("iPhone X") || -1 != t.indexOf("iPhone12") || -1 != t.indexOf("iPhone13");
            }, i.isLongScreen = function() {
                var t = i.PA.getSystemInfoSync();
                return t.windowHeight > t.windowWidth ? 1.8 < t.windowHeight / t.windowWidth : 1.8 < t.windowWidth / t.windowHeight;
            }, i.isPad = function() {
                var t = i.PA.getSystemInfoSync();
                return t.windowHeight > t.windowWidth ? t.windowHeight / t.windowWidth < 1.55 : t.windowWidth / t.windowHeight < 1.55;
            }, i.isiPad = function() {
                return -1 != i.PA.getSystemInfoSync().model.indexOf("iPad");
            }, i.isToday = function(t) {
                return Math.floor(t / 864e5) == Math.floor(Date.now() / 864e5);
            }, i.formatNumber = function(o) {
                if (o < 1e4) return o.toFixed();
                if (o < 1e6) return (o / 1e3).toFixed(1) + "K";
                if (o < 1e9) return (o / 1e3 / 1e3).toFixed(1) + "M";
                if (o < 1e12) return (o / 1e3 / 1e3 / 1e3).toFixed(1) + "B";
                if (o < 1e15) return (o / 1e3 / 1e3 / 1e3 / 1e3).toFixed(1) + "T"; {
                    let t = Math.round(o).toString(),
                        e = t.indexOf("e+");
                    if (0 < e) {
                        var n = t.substr(e + 2);
                        return t.substr(0, 4) + "E" + n;
                    }
                    n = Math.round(o).toString().length - 1;
                    return (o / Math.pow(10, n)).toFixed(1) + "E" + n;
                }
            }, i.formatTime = function(t) {
                let e = Math.floor(t / 3600),
                    o = Math.floor((t - 3600 * e) / 60),
                    n = Math.floor(t % 60),
                    a = "";
                return 0 < e && (a = (e < 10 ? "0" : "") + e.toFixed() + ":"), a + (o < 10 ? "0" : "") + o.toFixed() + ":" + (n < 10 ? "0" : "") + n.toFixed();
            }, i.rand = function(t, e) {
                var o = Math.floor(t + Math.random() * (e - t + 1)),
                    o = Math.min(o, e);
                return Math.max(o, t);
            }, i.randFloat = function(t, e) {
                return t + Math.random() * (e - t);
            }, i.saveRedirect = function(t, e, o) {
                const n = {};
                n.Openid = i.Info.openId, n.Channel = i.Info.channelId, n.Appid = i.Info.appId,
                    n.Type = t, n.TargetAppid = "", n.Path = "";
                let a = n;
                if ("string" == typeof e) a.TargetAppid = e, a.Path = o;
                else {
                    a.TargetAppid = e.appid, a.Path = e.path;
                    const t = {};
                    t.url = i.Urls.SaveRedirect, t.data = {}, t.method = "POST", t.success = () => {},
                        t.data.userId = i.Info.uid, t.data.redirectId = e.id, r(t);
                }
                r({
                    url: i.Urls.SaveRedirect,
                    data: a,
                    method: "POST",
                    success: () => {
                        console.log("Navigate to ", a);
                    }
                });
            }, i.loadServerConfig = function() {
                return new Promise((o, n) => {
                    i.request({
                        url: i.Urls.GameConfig + "?userId=" + i.Info.uid,
                        method: "POST",
                        data: [],
                        success: t => {
                            var e;
                            0 == (null === (e = null == t ? void 0 : t.data) || void 0 === e ? void 0 : e.code) ? o(t.data.data) : n(t.data);
                        },
                        fail: t => {
                            n(t);
                        }
                    });
                });
            };
    }(g = g || {}), (n = g = g || {}).version = "1.0.62", n.buildTime = "2022/3/2820:04:33",
    function(l) {
        let d;
        var t;
        (t = d = d || {})[t.Invalid = 0] = "Invalid", t[t.Loaded = 1] = "Loaded", t[t.Error = 2] = "Error",
            t[t.Shown = 3] = "Shown", t[t.Hidden = 4] = "Hidden";
        var i = new class {
            constructor() {
                this.initOptions = new Map(), this.showOptions = new Map(), this.ads = new Map(),
                    this.status = new Map(), this.showCount = new Map(), this.sizes = new Map(), this.tryShowCount = 0;
            }
            initBannerAd(t) {
                let e, o = null !== (t = null == (e = Array.isArray(t) ? t[0] : t) ? void 0 : e.adTag) && void 0 !== t ? t : "Banner";
                this.initOptions.set(o, e), this.status.set(o, d.Invalid);
                let n, a = l.PA.getSystemInfoSync(),
                    i;
                if (i = l.isPlatform([l.Platform.WeChat]) ? a.screenWidth > a.screenHeight ? 300 / a.designPixelRatio : a.screenWidth : Math.min(a.screenWidth, a.screenHeight),
                    l.isPlatform([l.Platform.Vivo])) n = {
                    posId: e.adId,
                    adIntervals: null == e ? void 0 : e.adIntervals,
                    style: {
                        left: 0,
                        top: (l.Info.resolution.height - 100) / l.PA.getSystemInfoSync().designPixelRatio
                    }
                };
                else {
                    const l = {
                        left: 0,
                        top: 0
                    };
                    l.width = i;
                    const d = {};
                    d.adUnitId = e.adId, d.adIntervals = null == e ? void 0 : e.adIntervals, d.style = l,
                        n = d;
                }
                let s = l.PA.createBannerAd(n);
                this.ads.set(o, s), s.onLoad(() => {
                    this.status.set(o, d.Loaded);
                }), s.onError(t => {
                    this.status.set(o, d.Error), l.warn("banner onError:", t);
                }), l.isPlatform([l.Platform.Vivo]) || s.onResize(t => {
                    const e = {};
                    e.width = t.width, e.height = t.height, this.sizes.set(o, e), this.updateBannerPosition(o);
                });
            }
            tryInitBannerAd(t) {
                var e, o;
                let n = null !== (e = t.initOption.adTag) && void 0 !== e ? e : "Banner";
                this.status.set(n, d.Invalid);
                let a, i = l.PA.getSystemInfoSync(),
                    s;
                if (s = l.isPlatform([l.Platform.WeChat]) ? i.screenWidth > i.screenHeight ? 300 / i.designPixelRatio : i.screenWidth : Math.min(i.screenWidth, i.screenHeight),
                    l.isPlatform([l.Platform.Vivo])) a = {
                    posId: t.initOption.adId,
                    adIntervals: null === (o = t.initOption) || void 0 === o ? void 0 : o.adIntervals,
                    style: {
                        left: 0,
                        top: (l.Info.resolution.height - 100) / l.PA.getSystemInfoSync().designPixelRatio
                    }
                };
                else {
                    const l = {
                        left: 0,
                        top: 0
                    };
                    l.width = s;
                    const d = {};
                    d.adUnitId = t.initOption.adId, d.adIntervals = null === (o = t.initOption) || void 0 === o ? void 0 : o.adIntervals,
                        d.style = l, a = d;
                }
                let r = l.PA.createBannerAd(a);
                this.ads.set(n, r), r.onLoad(() => {
                    this.status.set(n, d.Loaded), t.success();
                }), r.onError(t => {
                    this.status.set(n, d.Error), l.warn("banner onError:", t);
                }), l.isPlatform([l.Platform.Vivo]) || r.onResize(t => {
                    const e = {};
                    e.width = t.width, e.height = t.height, this.sizes.set(n, e), this.updateBannerPosition(n);
                });
            }
            updateBannerPosition(n) {
                var a, i, s;
                if (!l.isPlatform([l.Platform.Vivo])) {
                    let t = this.showOptions.get(n),
                        e = this.ads.get(n),
                        o = this.sizes.get(n);
                    e && o && (a = l.PA.getSystemInfoSync(), s = i = 0, i = null != (null === (n = null == t ? void 0 : t.style) || void 0 === n ? void 0 : n.offsetX) ? t.style.offsetX : (a.windowWidth - o.width) / 2,
                        s = null != (null === (n = null == t ? void 0 : t.style) || void 0 === n ? void 0 : n.offsetY) ? a.windowHeight - o.height - t.style.offsetY : a.windowHeight - o.height,
                        e.style.left = i, e.style.top = s, l.log("update banner position left:" + i + " top:" + s));
                }
            }
            showBanner(o) {
                var n;
                this.tryShowCount++;
                let a = null !== (n = null == o ? void 0 : o.adTag) && void 0 !== n ? n : "Banner",
                    i = this.sizes.get(a),
                    s = l.PA.getSystemInfoSync();
                if (this.showOptions.set(a, o), this.ads.has(a)) {
                    let t = this.ads.get(a),
                        e;
                    (e = null !== (n = null == o ? void 0 : o.style) && void 0 !== n && n.width ? o.style.width : l.isPlatform([l.Platform.WeChat]) ? s.screenWidth > s.screenHeight ? 300 / s.designPixelRatio : s.screenWidth : Math.min(s.screenWidth, s.screenHeight),
                        l.isPlatform([l.Platform.Vivo]) || (t.style.width = e), (null == i ? void 0 : i.width) == e && this.updateBannerPosition(a),
                        this.status.get(a) != d.Shown) ? t.show().then(() => {
                        this.tryShowCount = 0, this.status.set(a, d.Shown);
                    }).catch(() => {
                        try {
                            1 < this.tryShowCount ? (this.tryShowCount = 0, null == o || o.fail()) : this.tryInitBannerAd({
                                initOption: this.initOptions.get(a),
                                success: () => {
                                    this.showBanner(o);
                                }
                            });
                        } catch (t) {}
                    }): this.tryShowCount = 0;
                } else this.tryShowCount = 0, l.warn("显示banner失败,广告标签" + a + "不存在");
            }
            hideBanner(n) {
                var a, n = null != n ? n : "Banner";
                try {
                    if (this.ads.has(n)) {
                        this.showCount.has(n) ? this.showCount.set(n, this.showCount.get(n) + 1) : this.showCount.set(n, 1);
                        let t = this.showCount.get(n),
                            e = this.ads.get(n),
                            o = null === (a = this.initOptions.get(n)) || void 0 === a ? void 0 : a.validTimes;
                        e && (t && o && o <= t ? e.destroy && (this.showCount.delete(n), e.destroy(), this.status.set(n, d.Invalid),
                            this.initBannerAd(this.initOptions.get(n))) : e.hide && (e.hide(), this.status.set(n, d.Hidden)));
                    }
                } catch (t) {
                    t(t);
                }
            }
            hideAllBanner() {}
            resumeShowBanner() {}
            clearAllBanner() {}
            isExistBanner(t) {
                return !(!this.ads.has(t) || this.status.get(t) != d.Loaded && this.status.get(t) != d.Shown && this.status.get(t) != d.Hidden);
            }
        }();
        l.initBannerAd = function(t) {
            l.isPlatform([l.Platform.Android]) || null == i || i.initBannerAd(t);
        }, l.showBanner = function(t) {
            var e, o, n, a;
            l.isPlatform([l.Platform.Android, l.Platform.iOS]) ? (e = null !== (o = null === (a = null == t ? void 0 : t.style) || void 0 === a ? void 0 : a.offsetX) && void 0 !== o ? o : 0,
                o = null !== (a = null === (n = null == t ? void 0 : t.style) || void 0 === n ? void 0 : n.offsetY) && void 0 !== a ? a : 0,
                n = null !== (a = null === (n = null == t ? void 0 : t.style) || void 0 === n ? void 0 : n.width) && void 0 !== a ? a : 0,
                a = null !== (a = null === (a = null == t ? void 0 : t.style) || void 0 === a ? void 0 : a.height) && void 0 !== a ? a : 0,
                l.PA.showBanner(e, o, n, a)) : l.isPlatform(l.Platform.Kuaidianwan) ? GameAssistantWeb.showBanner() : null == i || i.showBanner(t);
        }, l.hideBanner = function(t) {
            l.isPlatform([l.Platform.Android, l.Platform.iOS]) ? l.PA.hideBanner() : l.isPlatform(l.Platform.Kuaidianwan) ? GameAssistantWeb.hideBanner() : null == i || i.hideBanner(t);
        }, l.hideAllBanner = function() {
            l.isPlatform([l.Platform.Android]) ? l.PA.hideAllBanner() : l.isPlatform(l.Platform.iOS) || null == i || i.hideAllBanner();
        }, l.resumeShowBanner = function() {
            l.isPlatform([l.Platform.Android]) ? l.PA.resumeShowBanner() : l.isPlatform(l.Platform.iOS) || null == i || i.resumeShowBanner();
        }, l.clearAllBanner = function() {
            l.isPlatform([l.Platform.Android]) ? l.PA.clearAllBanner() : l.isPlatform(l.Platform.iOS) || null == i || i.clearAllBanner();
        }, l.isExistBanner = function(t) {
            return null == i ? void 0 : i.isExistBanner(t);
        };
    }(g = g || {}), o = g = (g = g || {}) || {}, i = new class {}(), o.showFullScreenVideoAd = function() {
        o.Info.isPreview || (o.isPlatform(o.Platform.Kuaidianwan) ? GameAssistantWeb : o.PA).showFullScreenVideoAd();
    }, o.setFullScreenVideoAdPlayCallback = function(t) {
        i.playCallback = t;
    }, o.invokeFullScreenVideoAdPlayCallback = function(t) {
        var e;
        null === (e = null == i ? void 0 : i.playCallback) || void 0 === e || e.call(i, t);
    }, a = g = g || {}, r = new class {
        initGameBannerAd(t, e) {
            if (a.isPlatform([a.Platform.Vivo, a.Platform.OPPO]) && !a.Info.isPreview) {
                if (e || (e = {
                        left: 100 / a.PA.getSystemInfoSync().designPixelRatio,
                        top: (a.Info.resolution.height - 200) / a.PA.getSystemInfoSync().designPixelRatio,
                        orientation: "horizontal"
                    }), a.isOPPO()) {
                    const o = {};
                    o.adUnitId = t, o.style = e, this.gameBannerAd = a.PA.createGameBannerAd(o);
                } else if (a.isVivo()) {
                    const e = {};
                    e.posId = t, this.gameBannerAd = a.PA.createBoxBannerAd(e);
                }
                this.gameBannerAd.onError(t => {
                    a.log("GameBannerAd error:", t);
                }), this.gameBannerAd.onLoad(() => {
                    a.log("GameBannerAd loaded");
                });
            } else a.Info.isPreview || a.log("当前平台：" + a.Info.platform + "暂不支持互推横幅广告");
        }
        showGameBannerAd() {
            a.log("try show GameBannerAd"), this.gameBannerAd ? this.gameBannerAd.show().then(() => {
                console.log("GameBannerAd show success");
            }).catch(t => {
                console.log("GameBannerAd show fail with:" + t);
            }) : a.log("GameBannerAd not init");
        }
        hideGameBannerAd() {
            this.gameBannerAd ? (a.log("GameBannerAd hide"), this.gameBannerAd.hide()) : a.log("GameBannerAd not init");
        }
    }(), a.initGameBannerAd = function(t, e) {
        r.initGameBannerAd(t, e);
    }, a.showGameBannerAd = function() {
        r.showGameBannerAd();
    }, a.hideGameBannerAd = function() {
        r.hideGameBannerAd();
    }, s = g = g || {}, c = new class {
        constructor() {
            this.adUnitId = "";
        }
        initInterstitialAd(t) {
            this.adUnitId = t;
        }
        showInterstitialAd() {
            const t = {};
            t.adUnitId = this.adUnitId;
            let e = s.PA.createInterstitialAd(t);
            s.isPlatform([s.Platform.Vivo, s.Platform.Kwaigame]) ? e.show().then(() => {
                s.log("InterstitialAd show");
            }).catch(t => {
                s.log("InterstitialAd fail", JSON.stringify(t));
            }) : s.isPlatform([s.Platform.ByteDance]) ? e.load().then(() => {
                e.show().then(() => {
                    s.log("InterstitialAd show");
                });
            }).catch(t => {
                s.log(t);
            }) : (e.onError(t => {
                s.log("InterstitialAd error", t);
            }), e.onLoad(() => {
                s.log("InterstitialAd onLoad"), e.show().catch(t => {
                    s.error("show", t);
                });
            }), e.load().catch(t => {
                s.error("InterstitialAd err", t);
            }));
        }
    }(), s.initInterstitialAd = function(t) {
        c.initInterstitialAd(t);
    }, s.showInterstitialAd = function() {
        s.Info.isPreview || (s.isPlatform([s.Platform.iOS, s.Platform.Android]) ? s.PA : s.isPlatform(s.Platform.Kuaidianwan) ? GameAssistantWeb : c).showInterstitialAd();
    }, (l = g = g || {}).showNativeAd = function(t) {
        l.Info.isPreview || l.isPlatform([l.Platform.iOS, l.Platform.Android]) && l.PA.showNativeAd(t);
    }, l.hideNativeAd = function() {
        l.Info.isPreview || l.isPlatform([l.Platform.iOS, l.Platform.Android]) && l.PA.hideNativeAd();
    }, (g = g || {}).showOfferWallAd = function() {},
    function(n) {
        let a;
        var t;
        (t = a = a || {})[t.Default = 0] = "Default", t[t.Loading = 1] = "Loading", t[t.Loaded = 2] = "Loaded",
            t[t.Showing = 3] = "Showing", t[t.End = 4] = "End", t[t.Error = 5] = "Error";
        var e = new class {
            constructor() {
                this.adIds = [], this.currAdIdIdx = -1, this.ad = null, this.showOption = null,
                    this.videoPlayTimeStamp = 0, this.status = a.Default, this.closeTip = "看完视频才能获得奖励哦",
                    this.videoPlayCallbacks = [], this.videoPlayEndCallbacks = [], this.videoCloseCallbacks = [];
            }
            init(t) {
                this.adIds = t, this.currAdIdIdx = -1, this.initNextAd();
            }
            setCloseTip(t) {
                this.closeTip = t;
            }
            haveRewardVideo() {
                return n.isPlatform([n.Platform.iOS, n.Platform.Android]) ? n.PA.isRewardVideoAdReady() : this.status == a.Loaded;
            }
            onLoad() {
                this.status = a.Loaded;
            }
            onError(t) {
                var e;
                if (this.status = a.Error, this.showOption) {
                    if (!n.Info.isPreview) {
                        const a = {};
                        a.type = this.showOption.tag, a.page = null !== (e = this.showOption.page) && void 0 !== e ? e : "",
                            n.sentLog("VideoAdFailed", null, a);
                    }
                    const a = {
                        title: "抱歉，没有找到视频",
                        icon: "none",
                        mask: !1
                    };
                    n.PA.showToast(a), null === (e = this.showOption) || void 0 === e || e.result({
                        errorMsg: JSON.stringify(t),
                        reward: !1,
                        shown: !1
                    });
                }
                n.isPlatform([n.Platform.OPPO, n.Platform.Vivo]) && this.ad.load(), this.showOption = null;
            }
            onClose(e) {
                var t;
                e.isEnded ? (n.Info.rewardUserData.data.has(this.showOption.tag) && n.Info.rewardUserData.data.get(this.showOption.tag).currCount++,
                    this.videoCloseCallbacks.forEach(t => {
                        try {
                            t(e.isEnded);
                        } catch (t) {}
                    }), this.videoPlayEndCallbacks.forEach(t => {
                        try {
                            t();
                        } catch (t) {}
                    })) : this.videoCloseCallbacks.forEach(t => {
                    try {
                        t(e.isEnded);
                    } catch (t) {}
                }), this.status = a.End;
                const o = {};
                if (o.reward = null == e ? void 0 : e.isEnded, o.shown = !0, o.ecpm = null !== (t = e.ecpm) && void 0 !== t ? t : 0,
                    null === (t = this.showOption) || void 0 === t || t.result(o), n.Info.isPreview || n.sentLog(null != e && e.isEnded ? "VideoAdEnded" : "VideoAdClosed", Math.round((Date.now() - this.videoPlayTimeStamp) / 1e3), {
                        type: this.showOption.tag,
                        page: null !== (t = this.showOption.page) && void 0 !== t ? t : ""
                    }), n.isPlatform([n.Platform.OPPO, n.Platform.Vivo]) && !n.Info.isPreview && this.ad.load(),
                    this.showOption = null, this.status = a.End, (null == e || !e.isEnded) && this.closeTip && "" != this.closeTip) {
                    const a = {};
                    a.title = this.closeTip, a.mask = !0, a.icon = "none", n.PA.showToast(a);
                }
            }
            initNextAd() {
                if (0 < this.adIds.length && !n.isPlatform(n.Platform.Android))
                    if (this.currAdIdIdx = (this.currAdIdIdx + 1) % this.adIds.length,
                        this.status = a.Loading, n.isPlatform(n.Platform.Hago)) {
                        const a = {};
                        a.adUnitId = this.adIds[this.currAdIdIdx];
                        let t = window.hg.createRewardedVideoAd(a);
                        t.onClose = t => {
                            this.onClose(t);
                        }, t.onError = () => {
                            n.log("中途关闭广告或者拉取广告失败");
                        }, this.ad = t;
                    } else this.ad = n.PA.createRewardedVideoAd({
                        adUnitId: this.adIds[this.currAdIdIdx],
                        multiton: !1
                    }), this.ad.onLoad(() => {
                        this.onLoad();
                    }), this.ad.onError(t => {
                        this.onError(t);
                    }), this.ad.onClose(t => {
                        this.onClose(t);
                    }), n.isPlatform([n.Platform.OPPO, n.Platform.Vivo]) && this.ad.load();
            }
            showVideoAd(t) {
                if (this.showOption) n.log("reward video is showing with " + this.showOption.page + " - " + this.showOption.tag);
                else {
                    if (this.videoPlayTimeStamp = Date.now(), this.showOption = t, !n.Info.isPreview) {
                        const e = {};
                        e.type = this.showOption.tag, e.page = null !== (t = this.showOption.page) && void 0 !== t ? t : "",
                            n.sentLog("TryPlayVideoAd", null, e);
                    }
                    if (n.Info.isPreview) {
                        const n = {
                            isEnded: !0
                        };
                        this.onClose(n);
                    } else n.isPlatform(n.Platform.QuTouTiao) ? qttGame.showVideo(t => {
                        const e = {};
                        e.isEnded = 1 == t, this.onClose(e);
                    }) : n.isPlatform(n.Platform.Kuaidianwan) ? GameAssistantWeb.showRewardVideo(t => {
                        const e = {};
                        e.isEnded = t, this.onClose(e);
                    }) : n.isPlatform(n.Platform.Android) ? n.PA.showRewardVideoAd(t => {
                        var e;
                        if (n.log("reward video Android show callback:" + JSON.stringify(t)), t.shown) {
                            const n = {};
                            n.isEnded = t.reward, n.ecpm = t.ecpm, this.onClose(n);
                        } else this.showOption && (null === (e = this.showOption) || void 0 === e || e.result({
                            errorMsg: JSON.stringify(t),
                            reward: !1,
                            shown: !1
                        })), this.showOption = null;
                    }) : n.isPlatform(n.Platform.iOS) ? n.PA.showRewardVideoAd(t => {
                        var e;
                        if (n.log("reward video ios show callback:" + JSON.stringify(t)), t.shown) {
                            const n = {};
                            n.isEnded = t.reward, n.ecpm = t.ecpm, this.onClose(n);
                        } else this.showOption && (null === (e = this.showOption) || void 0 === e || e.result({
                            errorMsg: JSON.stringify(t),
                            reward: !1,
                            shown: !1
                        })), this.showOption = null;
                    }) : n.isPlatform(n.Platform.M4399MiniGame) ? window.h5api.playAd(t => {
                        if (n.log("code:" + t.code + ",message:" + t.message), 1e4 === t.code) this.videoPlayCallbacks.forEach(t => {
                            try {
                                t();
                            } catch (t) {}
                        });
                        else if (10001 === t.code) {
                            const n = {
                                isEnded: !0
                            };
                            this.onClose(n);
                        } else this.showOption = null, this.videoCloseCallbacks.forEach(t => {
                            try {
                                t();
                            } catch (t) {}
                        });
                    }) : (null == this.ad && this.initNextAd(), this.ad.show().then(() => {
                        this.videoPlayTimeStamp = Date.now(), this.showAdResult(!0, "");
                    }).catch(t => {
                        this.showAdResult(!1, JSON.stringify(t));
                    }));
                }
            }
            showAdResult(t, e) {
                var o;
                if (this.showOption && !n.Info.isPreview) {
                    const e = {};
                    e.type = this.showOption.tag, e.page = null !== (o = this.showOption.page) && void 0 !== o ? o : "",
                        n.sentLog(t ? "VideoAdSuccess" : "VideoAdFailed", null, e);
                }
                if (t) this.videoPlayCallbacks.forEach(t => {
                    try {
                        t();
                    } catch (t) {}
                });
                else {
                    n.isPlatform([n.Platform.OPPO, n.Platform.Vivo]) && this.ad.load();
                    const t = {
                        errCode: 1
                    };
                    t.errMsg = e, this.onError(t);
                }
            }
            addPlayCallback(t) {
                this.videoPlayCallbacks.push(t);
            }
            addPlayEndCallback(t) {
                this.videoPlayEndCallbacks.push(t);
            }
            addCloseCallback(t) {
                this.videoCloseCallbacks.push(t);
            }
            removePlayCallback(t) {
                t = this.videoPlayCallbacks.indexOf(t);
                0 <= t && this.videoPlayCallbacks.splice(t, 1);
            }
            removePlayEndCallback(t) {
                t = this.videoPlayEndCallbacks.indexOf(t);
                0 <= t && this.videoPlayEndCallbacks.splice(t, 1);
            }
            removeCloseCallback(t) {
                t = this.videoCloseCallbacks.indexOf(t);
                0 <= t && this.videoCloseCallbacks.splice(t, 1);
            }
        }();
        n.haveRewardVideo = function() {
            return e.haveRewardVideo();
        }, n.showVideoAd = function(t) {
            e.showVideoAd(t);
        }, n.initRewardVideoAd = function(t) {
            n.Info.isPreview || e.init(t);
        }, n.addVideoPlayCallback = function(t) {
            e.addPlayCallback(t);
        }, n.addVideoEndCallback = function(t) {
            e.addPlayEndCallback(t);
        }, n.addVideoCloseCallback = function(t) {
            e.addCloseCallback(t);
        }, n.removeVideoPlayCallback = function(t) {
            e.removePlayCallback(t);
        }, n.removeVideoEndCallback = function(t) {
            e.removePlayEndCallback(t);
        }, n.removeVideoCloseCallback = function(t) {
            e.removeCloseCallback(t);
        }, n.setInterruptPlayTip = function(t) {
            e.setCloseTip(t);
        };
    }(g = g || {}), (d = g = g || {}).showSplashAd = function() {
        var t;
        d.Info.isPreview || d.isPlatform(d.Platform.Kuaidianwan) || null === (t = d.PA.showSplashAd) || void 0 === t || t.call(d.PA);
    },
    function(n) {
        ! function(t) {
            var e;
            (e = t.Action || (t.Action = {}))[e.Active = 0] = "Active", e[e.Register = 1] = "Register",
                e[e.Pay = 2] = "Pay", e[e.NextDay = 6] = "NextDay", e[e.KeyAction = 25] = "KeyAction";
            const o = {
                clue_token: "",
                ad_id: "",
                creative_id: ""
            };
            t.init = function() {
                var t, e;
                n.isPlatform([n.Platform.WeChat]) && (e = n.PA.getLaunchOptionsSync(), o.clue_token = null !== (t = null === (t = null == e ? void 0 : e.query) || void 0 === t ? void 0 : t.clue_token) && void 0 !== t ? t : "",
                    o.ad_id = null !== (t = null === (t = null == e ? void 0 : e.query) || void 0 === t ? void 0 : t.ad_id) && void 0 !== t ? t : "",
                    o.creative_id = null !== (e = null === (e = null == e ? void 0 : e.query) || void 0 === e ? void 0 : e.creative_id) && void 0 !== e ? e : "",
                    n.addVideoEndCallback(() => {
                        n.request({
                            url: "https://game.17tcw.com/default/user/videoAd",
                            method: "POST",
                            data: {
                                userId: n.Info.uid,
                                adType: "RewardVideoAd",
                                ecpm: 0
                            },
                            success: t => {
                                n.log("RewardVideoAd: " + JSON.stringify(t));
                            }
                        });
                    }));
            }, t.reportKeyAction = function(t) {
                var e;
                0 < (null === (e = o.clue_token) || void 0 === e ? void 0 : e.length) && n.request({
                    url: "https://game.17tcw.com/default/put/reportWX",
                    method: "POST",
                    data: {
                        uid: n.Info.uid,
                        event_type: t,
                        clueToken: o.clue_token,
                        ad_id: o.ad_id
                    },
                    success: t => {
                        n.log("Report KeyAction: " + JSON.stringify(t));
                    }
                });
            }, t.videoAd = function() {};
        }(n.AdTracking || (n.AdTracking = {}));
    }(g = g || {}), (u = h = h || {}).AndroidProxy = class extends u.BaseAppProxy {
        constructor() {
            super(), this.compatibleMethods = ["onShareMessageToFriend", "showShareMenu", "onShareTimeline", "onShareAppMessage", "getUpdateManager", "onTouchEnd", "onTouchStart", "offTouchStart", "offTouchEnd", "triggerGC"],
                this.bridge = null, this.isSplashAdEnd = !1, this.splashAdEndCallback = null, this.callbacks = new Map(),
                this.times = 0, this.offerWallListener = null, this.compatibleMethods.forEach(t => {
                    this[t] = () => {
                        console.log("Android 暂不支持" + t);
                    };
                });
            try {
                this.bridge = PlatformClass.createClass("com.kariqu.sdkmanager.JavaScriptProxy");
            } catch (t) {}
        }
        signInGoogle() {
            p.signIn();
        }
        signInGoogleSilently() {
            p.signInSilently();
        }
        signOutGoogle() {
            p.signOut();
        }
        saveFile(t) {
            p.saveFile(t);
        }
        loadSavefile() {
            p.loadSavefile();
        }
        setNonConsumableProduct(t) {
            p.setAcknowledgedSku(t);
        }
        getProductDetail(t, e) {
            g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.loadSkuDetail(t, []) : this.native("requestProductInfo", "(Ljava/lang/String;I)V", JSON.stringify(t), null != e ? e : 0);
        }
        requestPayment(t, e) {
            g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.purchaseSku(t) : this.native("requestPayProduct", "(Ljava/lang/String;I)V", t, null != e ? e : 0);
        }
        checkPurchase() {
            g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.checkPurchase() : this.native("checkUnfinishedTransaction", "()V");
        }
        fetchRemoteConfig() {
            p.syncRemoteConfig();
        }
        confirmPurchase(t) {
            g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.confirmPurchase(t) : this.native("finishTransaction", "(Ljava/lang/String;)V", t);
        }
        getRemoteConfig() {
            return p.getRemoteConfig();
        }
        getOrderInfo(t) {
            return g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.getOrderInfo(t) : this.native("getTransactionInfo", "(Ljava/lang/String;)Ljava/lang/String;", t);
        }
        restoreNonConsumablePurchase() {
            g.isDistributionChannel(g.DistributionChannel.GooglePlay) ? p.recoverAcknowledgedPurchase() : this.native("restoreNonConsumableTransaction", "()V");
        }
        setUserId(t) {
            this.native("setUserId", "(Ljava/lang/String;)V", t);
        }
        setSplashAdEnd() {
            this.isSplashAdEnd = !0, this.splashAdEndCallback && this.splashAdEndCallback(),
                this.splashAdEndCallback = null;
        }
        afterSplashAd(t) {
            this.isSplashAdEnd ? t() : this.splashAdEndCallback = t;
        }
        native(t, e, ...o) {
            console.log("call android native " + t + " " + e + " " + o.join(","));
            try {
                return this.bridge ? (o.forEach(t => {}), this.bridge.call(t, ...o)) : jsb.reflection.callStaticMethod("com/kariqu/sdkmanager/JavaScriptProxy", t, e, ...o);
            } catch (t) {}
        }
        callCallback(t, ...e) {
            if (this.callbacks.has(t)) try {
                this.callbacks.get(t)(...e);
            } catch (t) {
                console.error(t);
            } finally {
                this.callbacks.delete(t);
            }
        }
        uuid() {
            return this.times++, Date.now() + "-" + this.times;
        }
        onShow(t) {}
        offShow(t) {}
        onHide(t) {}
        offHide(t) {}
        getSystemInfoSync() {
            return JSON.parse(this.native("getSystemInfoSync", "()Ljava/lang/String;"));
        }
        getLaunchOptionsSync() {
            let t = null,
                e = this.native("getLaunchOptionsSync", "()Ljava/lang/String;");
            if (e && "" != e) try {
                t = JSON.parse(e);
            } catch (t) {
                console.error(JSON.stringify(t));
            } else g.log("Android getLaunchOptionsSync error('').");
            return t;
        }
        exitMiniProgram() {
            this.native("exitApplication", "()V");
        }
        showRewardVideoAd(t) {
            var e = "showRewardVideoAd:" + this.uuid();
            this.callbacks.set(e, t);
            var o = "showRewardVideoAd:show:" + this.uuid();
            this.callbacks.set(o, t), this.native("showRewardVideoAd", "(Ljava/lang/String;Ljava/lang/String;)V", o, e);
        }
        showFullScreenVideoAd() {
            this.native("showFullScreenVideoAd", "()V");
        }
        showInterstitialAd() {
            this.native("showInterstitialAd", "()V");
        }
        showBanner(t, e, o, n) {
            const a = {};
            a.offsetX = null != t ? t : 0, a.offsetY = null != e ? e : 0, a.width = null != o ? o : 0,
                a.height = null != n ? n : 0, this.native("showBanner", "(Ljava/lang/String;)V", JSON.stringify(a));
        }
        hideBanner() {
            this.native("hideBanner", "()V");
        }
        showNativeAd(t) {
            var e;
            t.offsetX = null !== (e = t.offsetX) && void 0 !== e ? e : 0, t.offsetY = null !== (e = t.offsetY) && void 0 !== e ? e : 0,
                t.width = null !== (e = t.width) && void 0 !== e ? e : 0, t.height = null !== (e = t.height) && void 0 !== e ? e : 0,
                this.native("showNativeAd", "(Ljava/lang/String;)V", JSON.stringify(t));
        }
        hideNativeAd() {
            this.native("hideNativeAd", "()V");
        }
        showOfferWallAd(t) {
            this.offerWallListener = t, this.native("showOfferWallAd", "()V");
        }
        onOfferwallAdCredited(t, e) {
            var o;
            null === (o = this.offerWallListener) || void 0 === o || o.call(this, t, e);
        }
        onOfferwallAdClosed() {
            this.offerWallListener = null;
        }
        showToast(t) {
            this.native("showToast", "(Ljava/lang/String;)V", JSON.stringify(t));
        }
        getLanguage() {
            return this.native("getLanguage", "()Ljava/lang/String;");
        }
        showModal(t) {
            var e, o = "showModal:" + this.uuid();
            this.native("showModal", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", t.title, t.content, null !== (e = t.confirmText) && void 0 !== e ? e : "确认", t.showCancel ? null !== (e = t.cancelText) && void 0 !== e ? e : "取消" : "", o),
                this.callbacks.set(o, t.success);
        }
        showLoading(t) {
            this.native("showLoading", "(Ljava/lang/String;)V", t.title);
        }
        hideLoading(t) {
            this.native("hideLoading", "()V");
        }
        showShareMenu(t) {
            this.native("showShareMenu", "()V");
        }
        shareAppMessage(t) {
            this.native("shareAppMessage", "(Ljava/lang/String;)V", JSON.stringify(t));
        }
        getUserInfo(t) {}
        getWeChatOpenId(e) {
            let o = "getWeChatOpenId:" + this.uuid();
            this.callbacks.set(o, t => {
                e(null !== (t = t.openid) && void 0 !== t ? t : ""), this.callbacks.delete(o);
            }), this.native("getWeChatOpenId", "(Ljava/lang/String;)V", o);
        }
        login(t) {
            let e = "login:success:" + this.uuid();
            this.callbacks.set(e, t.success);
            let o = "login:fail:" + this.uuid();
            this.callbacks.set(o, t.fail);
            let n = "login:complete:" + this.uuid();
            this.callbacks.set(n, () => {
                this.callbacks.delete(e), this.callbacks.delete(o), this.callbacks.delete(n);
            }), this.native("login", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", e, o, n);
        }
        setKeepScreenOn(t) {}
        vibrateShort(t) {
            this.native("vibrateShort", "()V");
        }
        vibrateLong(t) {
            this.native("vibrateLong", "()V");
        }
        setClipboardData(t) {
            this.native("setClipboardData", "(Ljava/lang/String;)V", t.data);
        }
        getClipboardData(t) {
            try {
                t.success({
                    data: this.native("getClipboardData", "()Ljava/lang/String;")
                });
            } catch (t) {}
        }
        getBatteryInfo(t) {}
        getBatteryInfoSync() {
            return {
                level: 0,
                isCharging: !1
            };
        }
        onOceanEngineInit() {
            this.native("onOceanEngineInit", "()V");
        }
        reportKeyAction(t) {
            t ? this.native("reportKeyAction", "(Ljava/lang/String;)V", t) : this.native("reportKeyAction", "()V");
        }
        onOceanEngineRegister(t, e) {
            this.native("onOceanEngineRegister", "(Ljava/lang/String;Z)V", t, e);
        }
        onOceanEnginePurchase(t, e) {
            this.native("onOceanEnginePurchase", "(Ljava/lang/String;Z)V", t, e);
        }
        jumpLeisureSubject() {
            this.native("jumpLeisureSubject", "()V");
        }
        exitApplication() {
            this.native("exitApplication", "()V");
        }
        isRewardVideoAdReady() {
            return this.native("isRewardVideoAdReady", "()Z");
        }
        sendEvent(t, e) {
            this.native("sendEvent", "(Ljava/lang/String;Ljava/lang/String;)V", t, e);
        }
    },
    function(o) {
        window.AppProxy = o;
        const e = new class {
            constructor() {
                this.isAndroid = !1, this.isiOS = !1;
            }
            check(e) {
                if (null == o.PROXY) {
                    if (null == this.platform) {
                        try {
                            if (this.platform = jsb.reflection.callStaticMethod("com/kariqu/sdkmanager/JavaScriptProxy", "getPlatform", "()Ljava/lang/String;"), !this.platform) throw "";
                            console.log("Platform : Cocos Creator Android");
                        } catch (t) {
                            try {
                                if (this.platform = jsb.reflection.callStaticMethod("JavaScriptProxy", "getPlatform"), !this.platform) throw "";
                                console.log("Platform : Cocos Creator iOS");
                            } catch (t) {
                                try {
                                    if (this.platform = PlatformClass.createClass("com.kariqu.sdkmanager.JavaScriptProxy").call("getPlatform"), !this.platform) throw "";
                                    console.log("Platform : LayaAir Android");
                                } catch (t) {
                                    try {
                                        if (this.platform = PlatformClass.createClass("JavaScriptProxy").call("getPlatform"), !this.platform) throw "";
                                        console.log("Platform : LayaAir iOS");
                                    } catch (t) {
                                        console.log("Platform : null, default " + e), this.platform = null;
                                    }
                                }
                            }
                        }
                        null == this.platform && (this.platform = e);
                    }
                    console.log("AppProxy Platform is " + this.platform + " default is " + e), this.platform == g.Platform.Android ? (this.isAndroid = !0,
                        o.PROXY = new o.AndroidProxy(), console.log("AppProxy PROXY init " + (null == o.PROXY ? "failed" : "success") + " Platform:" + this.platform)) : this.platform == g.Platform.iOS && (this.isiOS = !0,
                        o.PROXY = new o.IOSProxy(), console.log("AppProxy PROXY init " + (null == o.PROXY ? "failed" : "success") + " Platform:" + this.platform));
                }
            }
            isAndroidApp() {
                return this.isAndroid;
            }
            isiOSApp() {
                return this.isiOS;
            }
        }();
        var t;
        let n;
        (t = o.ProductType || (o.ProductType = {}))[t.Consumable = 0] = "Consumable", t[t.NonConsumable = 1] = "NonConsumable",
            t[t.Subscription = 2] = "Subscription", (t = n = o.ListenerKey || (o.ListenerKey = {})).SIGN_IN = "SIGN_IN",
            t.SIGN_IN_FAILED = "SIGN_IN_FAILED", t.SIGN_OUT = "SIGN_OUT", t.SAVE_FILE = "SAVE_FILE",
            t.LOAD_SAVE_FILE = "LOAD_SAVE_FILE", t.REMOTE_CONFIG_SYNC = "REMOTE_CONFIG_SYNC",
            t.GOT_SKU_DETAIL = "GOT_PRODUCT_DETAIL", t.GOT_PRODUCT_DETAIL = "GOT_PRODUCT_DETAIL",
            t.PENDING_ORDER = "PENDING_ORDER", t.RECOVER_ACKNOWLEDGED_SKUS = "RESTORE_NONCONSUMABLE_PURCHASE",
            t.RESTORE_NONCONSUMABLE_PURCHASE = "RESTORE_NONCONSUMABLE_PURCHASE", t.PURCHASE_RESULT = "PURCHASE_RESULT";
        const a = new Map();

        function i(t) {
            return e.check(t), e.isAndroidApp() || e.isiOSApp();
        }
        o.isAPP = i, o.getPlatform = function() {
            return e.isiOSApp() ? g.Platform.iOS : e.isAndroidApp() ? g.Platform.Android : g.Platform.Default;
        };
        var s = null,
            r = !1;
        o.setSplashAdEndListener = function(t) {
            r || !i() || g.Info.isPreview ? null == t || t() : s = t;
        }, o.afterSplashAd = function() {
            console.log("AppProxy afterSplashAd"), r = !0, null == s || s();
        }, o.registListener = function(t, e) {
            a.set(t, e);
        }, o.unregistListener = function(t) {
            a.delete(t);
        }, o.onSignIn = function() {
            if (a.has(n.SIGN_IN)) try {
                a.get(n.SIGN_IN)();
            } catch (t) {}
        }, o.onSignInFailed = function(t) {
            if (a.has(n.SIGN_IN_FAILED)) try {
                a.get(n.SIGN_IN_FAILED)(t);
            } catch (t) {}
        }, o.onSignOut = function() {
            if (a.has(n.SIGN_OUT)) try {
                a.get(n.SIGN_OUT)();
            } catch (t) {}
        }, o.onSaveFile = function(t) {
            if (a.has(n.SAVE_FILE)) try {
                a.get(n.SAVE_FILE)(t);
            } catch (t) {}
        }, o.onLoadSavefile = function(t, e) {
            if (a.has(n.LOAD_SAVE_FILE)) try {
                a.get(n.LOAD_SAVE_FILE)(t, e);
            } catch (t) {}
        }, o.onRemoteConfigSynced = function(t) {
            if (a.has(n.REMOTE_CONFIG_SYNC)) try {
                a.get(n.REMOTE_CONFIG_SYNC)(t);
            } catch (t) {}
        }, o.onPendingOrder = function(t) {
            if (a.has(n.PENDING_ORDER)) try {
                a.get(n.PENDING_ORDER)(JSON.parse(t));
            } catch (t) {}
        }, o.onPurchaseResult = function(t, e) {
            if (a.has(n.PURCHASE_RESULT)) try {
                a.get(n.PURCHASE_RESULT)(t, e);
            } catch (t) {}
        }, o.onGotSkuDetail = function(t, e) {
            if (a.has(n.GOT_PRODUCT_DETAIL)) try {
                a.get(n.GOT_PRODUCT_DETAIL)(t, JSON.parse(e));
            } catch (t) {}
        }, o.onRestoreNonConsumablePurchase = function(t) {
            if (a.has(n.RESTORE_NONCONSUMABLE_PURCHASE)) try {
                a.get(n.RESTORE_NONCONSUMABLE_PURCHASE)(JSON.parse(t));
            } catch (t) {}
        }, o.signInGoogle = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.signInGoogle();
        }, o.signInGoogleSilently = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.signInGoogleSilently();
        }, o.signOutGoogle = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.signOutGoogle();
        }, o.saveFile = function(t) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.saveFile(t);
        }, o.loadSavefile = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.loadSavefile();
        }, o.setNonConsumableProduct = function(t) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.setNonConsumableProduct(t);
        }, o.getProductDetail = function(t) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.getProductDetail(t);
        }, o.requestPayment = function(t) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.requestPayment(t);
        }, o.checkPurchase = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.checkPurchase();
        }, o.fetchRemoteConfig = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.fetchRemoteConfig();
        }, o.confirmPurchase = function(t) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.confirmPurchase(t);
        }, o.getRemoteConfig = function() {
            var t;
            return null !== (t = null === o.PROXY || void 0 === o.PROXY ? void 0 : o.PROXY.getRemoteConfig()) && void 0 !== t ? t : new Map();
        }, o.getOrderInfo = function(t) {
            try {
                return JSON.parse(null === o.PROXY || void 0 === o.PROXY ? void 0 : o.PROXY.getOrderInfo(t));
            } catch (t) {
                return null;
            }
        }, o.restoreNonConsumablePurchase = function() {
            return null === o.PROXY || void 0 === o.PROXY ? void 0 : o.PROXY.restoreNonConsumablePurchase();
        }, o.onOfferwallAdCredited = function(t, e) {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.onOfferwallAdCredited(t, e);
        }, o.onOfferwallAdClosed = function() {
            null === o.PROXY || void 0 === o.PROXY || o.PROXY.onOfferwallAdClosed();
        };
    }(h = h || {}),
    function(t) {
        window.GoogleService = t;
        var n = null;

        function a(e, t, ...o) {
            console.log("call android native " + e + " " + t + " " + o.join(","));
            try {
                return jsb.reflection.callStaticMethod("com/kariqu/googleservice/GSSDK", e, t, ...o);
            } catch (t) {
                return (n = null == n ? PlatformClass.createClass("com.kariqu.googleservice.GSSDK") : n).call(e, ...o);
            }
        }
        t.signIn = function() {
            a("signIn", "()V");
        }, t.signInSilently = function() {
            a("signInSilently", "()V");
        }, t.signOut = function() {
            a("signOut", "()V");
        }, t.saveFile = function(t) {
            a("saveFile", "(Ljava/lang/String;)V", t);
        }, t.loadSavefile = function() {
            a("loadSavefile", "()V");
        }, t.setAcknowledgedSku = function(t) {
            a("setAcknowledgedSku", "(Ljava/lang/String;)V", JSON.stringify(t));
        }, t.loadSkuDetail = function(t, e) {
            a("loadSkuDetail", "(Ljava/lang/String;Ljava/lang/String;)V", JSON.stringify(t), JSON.stringify(e));
        }, t.purchaseSku = function(t) {
            a("purchaseSku", "(Ljava/lang/String;)V", t);
        }, t.checkPurchase = function() {
            a("checkPurchase", "()V");
        }, t.syncRemoteConfig = function() {
            a("syncRemoteConfig", "()V");
        }, t.confirmPurchase = function(t) {
            a("confirmPurchase", "(Ljava/lang/String;)V", t);
        }, t.getRemoteConfig = function() {
            var t, e = a("getRemoteConfig", "()Ljava/lang/String;");
            g.log("Google RemoteConfig is " + e);
            let o = JSON.parse(e),
                n = new Map();
            for (t of Object.keys(o)) n.set(t, o[t]);
            return n;
        }, t.getOrderInfo = function(t) {
            return a("getOrderInfo", "(Ljava/lang/String;)Ljava/lang/String;", t);
        }, t.recoverAcknowledgedPurchase = function() {
            return a("recoverAcknowledgedPurchase", "()V");
        };
    }(p = p || {}), (f = h = h || {}).IOSProxy = class extends f.BaseAppProxy {
        constructor() {
            super(), this.compatibleMethods = ["onShareMessageToFriend", "showShareMenu", "onShareTimeline", "onShareAppMessage", "getUpdateManager", "onTouchEnd", "onTouchStart", "offTouchStart", "offTouchEnd", "triggerGC"],
                this.bridge = null, this.callbacks = new Map(), this.callbackValidTimes = new Map(),
                this.times = 0, this.compatibleMethods.forEach(t => {
                    this[t] = () => {
                        console.log("iOS 暂不支持" + t);
                    };
                });
            try {
                this.bridge = PlatformClass.createClass("JavaScriptProxy");
            } catch (t) {}
        }
        native(t, ...e) {
            let o = null,
                n = null;
            try {
                g.isEngine(g.EngineType.CocosCreator) ? o = e ? jsb.reflection.callStaticMethod("JavaScriptProxy", t, ...e) : jsb.reflection.callStaticMethod("JavaScriptProxy", t) : g.isEngine(g.EngineType.LayaAir) && (o = e ? this.bridge.call(t, ...e) : this.bridge.call(t));
            } catch (t) {
                n = t;
            }
            return n ? (console.log("call ios native ", t, " error."), console.error(n)) : console.log("call ios native ", t, " return:", o),
                o;
        }
        sendEvent(t, e) {
            this.native("sendEvent:params:", t, null != e ? e : "");
        }
        callCallback(t, ...e) {
            if (this.callbacks.has(t)) {
                console.log("ios call jscallback : ", t, JSON.stringify(e));
                try {
                    this.callbacks.get(t)(...e);
                } catch (t) {
                    console.error(t);
                } finally {
                    var o = this.callbackValidTimes.get(t);
                    1 < o ? this.callbackValidTimes.set(t, o - 1) : (this.callbacks.delete(t), this.callbackValidTimes.delete(t));
                }
            } else console.log("ios call jscallback(not exist): ", t, JSON.stringify(e));
        }
        addCallback(t, e, o) {
            this.callbacks.set(t, e), this.callbackValidTimes.set(t, o);
        }
        uuid() {
            return this.times++, Date.now() + "-" + this.times;
        }
        onShow(t) {}
        offShow(t) {}
        onHide(t) {}
        offHide(t) {}
        getSystemInfoSync() {
            var t;
            return JSON.parse(null !== (t = this.native("getSystemInfoSync")) && void 0 !== t ? t : "{}");
        }
        getLaunchOptionsSync() {
            var t;
            return JSON.parse(null !== (t = this.native("getLaunchOptionsSync")) && void 0 !== t ? t : "{}");
        }
        exitMiniProgram() {
            this.native("exitMiniProgram");
        }
        showRewardVideoAd(t) {
            var e = "showRewardVideoAd:show:" + this.uuid();
            this.addCallback(e, t, 2), this.native("showRewardVideoAd:scene:", e, "");
        }
        showFullScreenVideoAd() {
            this.native("showFullScreenVideoAd:", "");
        }
        showInterstitialAd() {
            this.native("showInterstitial");
        }
        showBanner(t, e, o, n) {
            this.native("showBannerAdWithOffsetX:offsetY:width:height:", t, e, o, n);
        }
        hideBanner() {
            this.native("hideBannerAd");
        }
        showNativeAd(t) {
            var e;
            this.native("showNativeAdWithOffsetX:offsetY:width:height:", null !== (e = t.offsetX) && void 0 !== e ? e : 0, null !== (e = t.offsetY) && void 0 !== e ? e : 0, null !== (e = t.width) && void 0 !== e ? e : 0, null !== (t = t.height) && void 0 !== t ? t : 0);
        }
        hideNativeAd() {
            this.native("hideNativeAd");
        }
        showToast(t) {
            t.duration && 100 < t.duration && (t.duration = t.duration / 1e3), this.native("showToast:duration:", t.title, null !== (t = t.duration) && void 0 !== t ? t : 1.5);
        }
        showModal(t) {
            var e, o = "showModal:" + this.uuid();
            this.native("showModal:content:showCancel:cancelText:confirmText:callbackKey:", t.title, t.content, !!t.showCancel, null !== (e = t.cancelText) && void 0 !== e ? e : "取消", null !== (e = t.confirmText) && void 0 !== e ? e : "确认", o),
                this.addCallback(o, t.success, 1);
        }
        showLoading(t) {
            var e;
            this.native("showLoading:mask:", null !== (e = t.title) && void 0 !== e ? e : "", !!t.mask);
        }
        hideLoading(t) {
            this.native("hideLoading");
        }
        showShareMenu(t) {
            this.native("showShareMenu");
        }
        shareAppMessage(t) {}
        login(t) {
            var e = this.native("login");
            const o = {};
            o.code = e, null === (e = null == t ? void 0 : t.success) || void 0 === e || e.call(t, o);
        }
        setUserId(t) {
            this.native("setUserId:", t);
        }
        setKeepScreenOn(t) {}
        vibrateShort(t) {
            this.native("vibrate:", 15);
        }
        vibrateLong(t) {
            this.native("vibrate:", 400);
        }
        setClipboardData(t) {
            this.native("setClipboardData:", null !== (t = t.data) && void 0 !== t ? t : "");
        }
        getClipboardData(t) {
            try {
                t.success({
                    data: this.native("getClipboardData")
                });
            } catch (t) {}
        }
        getBatteryInfo(t) {}
        getBatteryInfoSync() {
            return {
                level: 0,
                isCharging: !1
            };
        }
        onOceanEngineInit() {
            this.native("onOceanEngineInit");
        }
        reportKeyAction(t) {
            t ? this.native("reportKeyAction:", t) : this.native("reportKeyAction");
        }
        onOceanEngineRegister(t, e) {
            this.native("onOceanEngineRegister:success:", t, e);
        }
        onOceanEnginePurchase(t, e) {
            this.native("onOceanEnginePurchase:success:", t, e);
        }
        getMenuButtonBoundingClientRect() {
            return {
                top: this.native("getTopUnsafeArea"),
                left: 0,
                right: 0,
                bottom: 0,
                width: 0,
                height: 0
            };
        }
        exitApplication() {
            this.native("exitApplication");
        }
        isRewardVideoAdReady() {
            return this.native("isRewardVideoAdReady");
        }
        getProductDetail(t) {
            this.native("getProductsInfo:", JSON.stringify(t));
        }
        requestPayment(t) {
            this.native("payProduct:", t);
        }
        checkPurchase() {
            this.native("checkPurchase");
        }
        confirmPurchase(t) {
            this.native("confirmPurchase:", t);
        }
        getOrderInfo(t) {
            return this.native("getTransactionInfo:", t);
        }
        restoreNonConsumablePurchase() {
            this.native("restoreNonConsumablePurchase");
        }
        fetchRemoteConfig() {
            this.native("fetchRemoteConfig");
        }
        getRemoteConfig() {
            let t = this.native("getRemoteConfig"),
                e = JSON.parse(t),
                o = new Map();
            for (var n of Object.keys(e)) o.set(n, e[n]);
            return o;
        }
    }, (m = g = g || {}).PlatformAdapter = class {
        constructor() {
            this.platform = m.Platform.Default;
        }
    };